Use C abort function to immediately terminate a program

Syntax

C abort function has the following syntax. void abort(void);

C abort function is from header file stdlib.h.

Description

The abort() function causes immediate abnormal termination of a program.

Example

Use C abort function to terminate a program.


#include <stdlib.h>
#include <stdio.h>
//ww w  . j  a  v  a2s  .c om
int main(void)
{
  abort();
  return 0;
}

The code above generates the following result.





















Home »
  C Language »
    Function Reference »




assert.h
ctype.h
math.h
setjmp.h
signal.h
stdio.h
stdlib.h
string.h
time.h
wctype.h