User Tools

Site Tools


c:stdio.h:ferror

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c:stdio.h:ferror [2013/01/22 22:02]
127.0.0.1 external edit
c:stdio.h:ferror [2024/02/16 01:05] (current)
Line 23: Line 23:
   handle = fopen("test.txt","r");   handle = fopen("test.txt","r");
  
-  if (handle!=NULL) +  if (handle!=NULL) {    
-  {    +
     printf ("its all fine\n");     printf ("its all fine\n");
     putc('X',handle);     putc('X',handle);
     if (ferror(handle)) { printf ("error in writing to file\n");}      if (ferror(handle)) { printf ("error in writing to file\n");} 
     fclose (handle);     fclose (handle);
 +  } else {
 +    perror ("error opening file for reading\n");
   }   }
-  else 
-       { 
-           perror ("error opening file for reading\n"); 
-       } 
   return 0;   return 0;
 } }

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
c/stdio.h/ferror.txt · Last modified: 2024/02/16 01:05 (external edit)

Impressum Datenschutz