abort()

Abnormallly terminates program.

  #include <stdlib.h>
  
  void abort(void)    
Remarks

The abort() function raises the SIGABRT signal and quits the program to returnto the operating system.

The abort() function will not terminate the program if a programmer-installed signal handler uses longjmp() instead of returning normally.

Listing: Example of abort() Usage

#include <stdlib.h>

#include <stdio.h>

int main(void)

{

char c;

printf("Aborting the program.\n");

printf("Press Return.\n");

/* Wait for the Return key to be pressed. */

c = getchar();

/* Abort the program. */

abort();

return 0;

}

Output:

Aborting the program.

Press Return.