User Tools

Site Tools


c:stdio.h:ferror
click
to support this page (eg 0,42 € or so) Thanks.

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 [2013/07/26 11:32] (current)
59.120.74.67 [C Sourcecode Example] indentation
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;
 } }
advertising
c/stdio.h/ferror.txt · Last modified: 2013/07/26 11:32 by 59.120.74.67

Impressum