Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C - <b>tmpnam() generate a temporary file name</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
tmpnam()                 Generate a Temporary File Name

 #include   <stdio.h>

 char       *tmpnam(string);
 char       *string;                     Pointer to temporary name

    tmpnam() generates a temporary file name, stored in 'string', that
    can be used as a temporary file.  If 'string' is NULL,  malloc() is
    used to allocate memory for the string.  (Use free() to deallocate
    the memory when it's no longer needed.)  The character string
    'string' created by tmpnam() is made up of digit characters '1' to
    '9' and can have a value of 1 to 65535.

    Returns:    A pointer to the name generated.  A NULL value is
                returned if the name cannot be created or already exists.

  -------------------------------- Example ---------------------------------

    The following statements create a temporary file name.

         #include <stdio.h>

         char *name;

         main()
         {
             if ((name = tmpnam(NULL)) != NULL) {
                 printf("temp name assigned: %s\n",name);
              }
              else
                 printf("unable to open temp file\n");
         }

See Also: tempnam() tmpfile() mktemp()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson