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 6.0 - <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 and stores it in 'string'.
    This file name can then be used for 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
    digit characters '1' to '9' are used to create 'string', which 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.

 Portability:   Not supported by ANSI standard.

   -------------------------------- 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