Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <signal.h>
- int stan = 0;
- void funkcja()
- {
- stan = 1;
- }
- void funkcja2()
- {
- stan = 2;
- printf("Serwus\n");
- exit(0);
- }
- int main()
- {
- signal(SIGQUIT, funkcja);
- signal(SIGINT, funkcja2);
- while (stan != 2) {
- if (stan == 1) {
- printf(":)\n");
- } else {
- printf(":(\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement