Last active
July 31, 2018 23:42
-
-
Save AkhandMishratruth/e26ed367225dc18f951184fb8d392bfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <signal.h> | |
void handler(int signal_number){ | |
printf("Interrupt occured, Ctrl + C is pressed\n"); | |
} | |
int main(){ | |
signal(SIGINT, handler); | |
while(1){ | |
sleep(1); | |
printf("Waiting for interrupt\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment