tmpnam - C stdio.h

C examples for stdio.h:tmpnam

Type

function

From


<cstdio>
<stdio.h>

Description

Generate temporary filename

Prototype

char * tmpnam ( char * str );

Parameters

ParameterDescription
str Pointer of characters where the temporary name will be stored.

Return Value

On success, a pointer containing the name for a temporary file

Demo Code


#include <stdio.h>

int main ()//from ww  w.  j a  v  a  2  s .  c o m
{
  char buffer [L_tmpnam];
  char * pointer;

  tmpnam (buffer);
  printf ("Tempname #1: %s\n",buffer);

  pointer = tmpnam (NULL);
  printf ("Tempname #2: %s\n",pointer);

  return 0;
}

Related Tutorials