Handle Interrupt Signal in C/C++
Keyboard shortcut like Ctrl+C is used to pass SIGTERM event to program.
A signal handler can be set to catch when Ctrl+C is pressed to avoid execution termination. Here is a program that avoids Ctrl+C event 3 times then exits.
#include <stdio.h>
#inc...
blog.mdminhazulhaque.io1 min read