##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# tmpfile

From cppreference.com
< c‎ | io

Defined in header `<stdio.h>` |  |
FILE *tmpfile(); |  |

Opens a temporary file. The file is opened as binary file for update (`"wb+` mode). The filename of the file is guaranteed to be unique within the filesystem.

The file will be closed when the program exits.

### [edit] Parameters

(none)

### [edit] Return value

The associated file stream or NULL if an error has occurred

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

tmpnam | returns a unique filename (function) [edit]
C++ documentation for tmpfile

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/io/tmpfile&oldid=56479"
Category:

- Todo no example