#include <stdio.h>char *tmpnam(char *name);
The tmpnam( ) function generates a unique filename and stores it in the array pointed to by name. This array must be at least L_tmpnam characters long. (L_tmpnam is defined in <stdio.h>.) The main purpose of tmpnam( ) is to generate a temporary filename that is different from any other file in the current disk directory.
The function can be called up to TMP_MAX times. TMP_MAX is defined in <stdio.h>, and it will be at least 25. Each time tmpnam( ) is called, it will generate a new temporary filename.
A pointer to name is returned on success; otherwise, a null pointer is returned. If name is null, then the temporary filename is held in a static array owned by tmpnam( ) and a pointer to this array is returned. This array will be overwritten by a subsequent call.
A related function is tmpfile( ).