#include <stdio.h>FILE *tmpfile(void);
The tmpfile( ) function opens a temporary binary file for read/write operations and returns a pointer to the stream. The function automatically uses a unique filename to avoid conflicts with existing files.
The tmpfile( ) function returns a null pointer on failure; otherwise, it returns a pointer to the stream.
The temporary file created by tmpfile( ) is automatically removed when the file is closed or when the program terminates.
You can open TMP_MAX temporary files (up to the limit set by FOPEN_MAX).
A related function is tmpnam( ).