Signals
User hitting a break key, a floating point exception, a loss of carrier on a phone line, segmentation violation, or a bus error are reported to the program by means of a signal.
A signal handler is a procedure that takes as an argument a single integer value. This integer is used to encode the type of signal being processed:
# include <signal.h> // include signal definitionsvoid handler (int a) { // handle the signal // ... // reset the signal handler signal (a, handler);}