#include <stdio.h>
#include <stdlib.h>
// In C, abort() causes the program to terminate abnormally immediately. Unlike exit(),
// it does not perform normal cleanup such as calling functions registered with atexit()
// or flushing all open streams.
int main () {
FILE *fp;
fp = fopen("afile.txt","r" );
if (fp == NULL) {
fprintf(stderr, "error opening afile.txt abort()\n");
abort();
}
printf("Close afile.txt\n");
fclose(fp);
return(0);
}
/*
run:
error opening afile.txt abort()
Command terminated by signal 6
*/