cpp/io/c/tmpfile

Creates and opens a temporary file with a unique auto-generated filename.

The file is opened as a binary file for update (as by std with access mode ). At least tmp_max files may be opened during the lifetime of a program (this limit may be shared with std and may be further limited by fopen_max).

If the program closes the file, e.g. by executing std, the file is automatically deleted.

If the program terminates normally (by calling std, returning from, etc), all files that were opened by calling are also automatically deleted.

If the program terminates abnormally, it is implementation-defined if these temporary files are deleted.

Parameters
(none)

Return value
The associated file stream or a null pointer if an error has occurred