In C Programming Language, the tmpfile() function is used to produce/create a temporary file.
- tmpfile() function is defined in the “stdio.h” header file.
- The created temporary file will automatically be deleted after the termination of program.
- It opens file in binary update mode i.e., wb+ mode.
- The syntax of tmpfile() function is:
- The tmpfile() function always returns a pointer after the creation of file to the temporary file. If by chance temporary file can not be created, then the tmpfile() function returns NULL pointer.
Temporary file is created Hello GeeksforGeeks
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.
- rename function in C/C++
- fgets() and gets() in C language
- Interesting facts about data-types and modifiers in C/C++
- pthread_self() in C with Example
- fgetc() and fputc() in C
- fseek() in C/C++ with example
- Converting string to number and vice-versa in C++
- Difference between getc(), getchar(), getch() and getche()
- C program to delete a file
- fopen() for an existing file in write mode
- To find sum of two numbers without using any operator
- Memory Layout of C Programs
- fseek() vs rewind() in C
- EOF, getc() and feof() in C
- Storage for Strings in C