Help us and donate little Bitcoins to pay the server costs: 1AXLPuRUBYc1JczTW4XS65GL6oWjNP2Vt2

User Tools

Site Tools


Programming Reference/Librarys

Question & Answer

because of the inhumane working conditions at amazon in Germany, I will offer the Amazon app no more! (ARD Reportage)

Table of Contents


    char *tmpnam(char *str);

Assigns to s (if s non-null) and returns unique name for a temporary file. Unique name is returned for each of the first TMP_MAX invocations.

C Sourcecode Example

 * tmpnam example code
#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
int main ( void ) 
FILE *tmpstream;
char *tmpfile;
tmpfile = tmpnam(NULL);
tmpstream= fopen(tmpfile, "w");
if ( tmpstream == NULL) {
  perror("Error opening tmp stream");
fputs("Test for tmpnam", tmpstream);
rename(tmpfile, "test.txt");
return 0;

content of test.txt after executing ./tmpnam

Test for tmpnam


c/stdio.h/tmpnam.txt · Last modified: 2013/01/22 22:02 (external edit)

The new Question & Answer System is online and waiting for your Questions about Programming problems Impressum