How can I implement signal Handling for Ctrl-C and Ctrl-D in C....So If Ctrl-C is pressed then the program will ignore and try to get the input from the user again...If Ctrl
This is a program for handling signal when pressed Ctrl+c
The syntax for signal function is : signal(signal name, function name);
#include
#include // for handling signal
void signal_handler()
{
printf("Signal Handled here\n");
}
main()
{
printf("In main function..\n");
// SIGINT is signal name create when Ctrl+c will pressed
signal(SIGINT,signal_handler);
sleep(15);
printf("In main after called from signal_handle \n");
}