Mega Code Archive

 
Categories / C / Development
 

Abort current process returning error code

#include <stdio.h> #include <stdlib.h> int main () {   FILE *file;      file= fopen ("my.txt","r");      if (file == NULL) {        printf ("error reading file\n");        abort();   }   fclose (file);   return 0; }