abort Function

Aborts the current process.

Include

<stdlib.h>

Prototype

void abort(void);

Remarks

abort will cause the processor to reset.

Example

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

int main(void)
{
  FILE *myfile;

  if ((myfile = fopen("samp.fil", "r")) == NULL)
  {
    printf("Cannot open samp.fil\n");
    abort();
  }
  else
    printf("Success opening samp.fil\n");

  fclose(myfile);
}

Example Output

Cannot open samp.fil
ABRT