Generate a unique temporary filename: tmpnam : File Temp « File « C / ANSI-C






Generate a unique temporary filename: tmpnam

 Generate a unique temporary filename: tmpnam

#include <stdio.h>

int main ()
{
  char buffer[L_tmpnam];
  char *pointer;

  tmpnam (buffer);
  printf ("Temp file name #1: %s\n",buffer);

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

  return 0;  
}

           
       








Related examples in the same category

1.Create temp file name
2. Open a temporary file: how to use tmpfile