Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>abort</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
abort

Usage

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

   ANSI

Description

   The abort function terminates the currently executing program. It is the
   same as a function call to _exit with a non-zero status. abort can be
   intercepted using the signal SIGABRT (see the function signal). abort
   does not flush the buffers nor does it call C++ static destructors. It is
   preferable to use exit rather than abort for C++ programs.

Example 

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

   int main()
   {
       FILE *fp;
       fp = fopen("file.dat","r");
       if(fp == NULL)
           {
               fprintf(stderr,"Could not open file.dat\n");
               abort();
           }
       printf("File opened\n");
       return EXIT_SUCCESS;
   }

See Also

   exit, _exit, raise


See Also: exit _exit raise

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson