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

    FILE *tmpfile(void);


Creates temporary file which will be removed when closed or on normal program termination.
standard mode (mode “wb+”)
Returns stream or NULL on failure.

C Sourcecode Example

 * tmpfile example code
#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
int main ( void )
  FILE *stream = tmpfile();
  char c;
  if( stream == NULL ) {
  perror("Error opening tmp file");
 fputs("Test 1234", stream);
  while((c = fgetc(stream) ) != EOF) {
    printf("%c", c);
 fclose (stream);
  return 0;


  output: ./tmpfile
  Test 1234
c/stdio.h/tmpfile.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