The tmpnam() function is a special function which is declared inside “stdio.h” header file. It generates a different temporary file name each time it is called up to at least TMP_MAX names. Here TMP_MAX represents maximum number of different file names that can be produce by tmpnam() function. If it is called more than TMP_MAX times, the behavior is implementation dependent.Here, L_tmpnam define the size needed for an array of char to hold the result of tmpnam.
char *tmpnam(char *str) s : The character array to copy the file name. It generates and returns a valid temporary filename which does not exist. If str is null then it simply returns the tmp file name.
The file names are dependent on running machine, which can be anything. Example: /tmp/fileRTOA0m \s260. \s3ok. \s5gg. etc
This article is contributed by Bishal Kumar Dubey. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- How to call function within function in C or C++
- arc function in C
- fegetexceptflag() function in C/C++
- fegetenv() function in C/C++
- wctrans() function in C/C++
- wmemcpy() function in C/C++
- strnset() function in C
- wcsncmp() function in C/C++
- wcsrtombs() function in C/C++
- wcstod() function in C/C++
- wcstol() function in C/C++
- wcsncat() function in C/C++
- wcstoul() function in C/C++
- wmemcmp() function in C/C++
- wmemchr() function in C/C++
- wcrtomb() function in C/C++
- vswprintf() function in C/C++
- strlwr() function in C
- clock() function in C/C++
- toupper() function in C