User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







c:stdlib.h:abort
click
to support this page (eg 0,42 € or so) Thanks.

abort

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

Cause abnormal program termination, and try to catch SIGABRT.

no return value

C Sourcecode Example

#include <stdio.h> /* including standard library */
//#include <windows.h> /* uncomment this for Windows */
 /* for printf */
#include <stdlib.h>
int main( void )
{
  int x=2,y=5,i;
  i=x+y;
 
  printf("x = %i | y = %i\n", x, y);
 
  abort();
 
  /* will never execute, abort will terminate the programm */
  printf("result of %i+%i= %i", x, y, i);
 
  return 0;
}

output with abort:

  user@host:~/code-reference.com# ./abort
  x = 2 | y = 5
  aborted

output without abort

  user@host:~/code-reference.com# ./abort
  x = 2 | y = 5
  result of 2+5= 7 
advertising
c/stdlib.h/abort.txt · Last modified: 2013/01/22 22:02 (external edit)

Impressum