home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_06
/
8n06031a
< prev
next >
Wrap
Text File
|
1990-04-18
|
503b
|
38 lines
*****Listing 5*****
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <assert.h>
void eh(void);
void abort_hand(void);
main()
{
char c;
atexit(eh);
if (signal(SIGABRT, abort_hand) == SIG_ERR) {
printf("Can't register abort_hand\n");
exit(1);
}
printf("Enter A (abort), E (exit): ");
c = getchar();
assert(c != 'A');
}
void eh(void)
{
printf("Inside eh\n");
}
void abort_hand(void)
{
printf("Inside abort_hand\n");
exit(2);
}