1#include <iostream>
2#include <csignal>
3
4using namespace std;
5
6sig_atomic_t signalled = 0;
7
8void handler(int sig)
9{
10 signalled = 1;
11}
12
13int main()
14{
15 signal(SIGINT, handler);
16
17 raise(SIGINT);
18 if (signalled)
19 cout << "Signal is handled";
20 else
21 cout << "Signal is not handled";
22
23 return 0;
24}