Terminate calling process: how to use exit : Exit Abort « Development « C / ANSI-C






Terminate calling process: how to use exit



#include <stdio.h>
#include <stdlib.h>

int main ()
{
  FILE *file;
  file = open ("my.txt","r");
  
  if (file==NULL)
  {
    printf ("Error opening file");
    exit (1);
  }
  
  return 0;
}

           
       








Related examples in the same category

1.Assign function which is called when exit
2.Abort current process returning error code: how to use abort
3. Specifies a function to be executed at exit: how to use atexit