tmpfile() – I/O Function
How is “tmpfile()” used in C++?
is an I/O function which is used to open temporary file for update which will be deleted when the stream closes. If the temporary file is created the function returns a stream pointer, otherwise NULL is returned.
FILE * tmpfile ( void );
int main ()
FILE * str = tmpfile ();
In the above example the opened temporary file will get closed when the stream “str” is closed.