VOOZH about

URL: https://www.geeksforgeeks.org/c/tmpfile-function-c/

⇱ tmpfile() function in C - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

tmpfile() function in C

Last Updated : 4 Sep, 2017
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:
    FILE *tmpfile(void) 
  • 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.
Output:
Temporary file is created
Hello GeeksforGeeks
Comment
Article Tags: