?? singal.c
字號(hào):
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
void catch_int(int sig_num)
{
// 重新設(shè)置 SIGINT 的 handler
signal(SIGINT, catch_int);
printf("Control-C is ignored, please don't waste time.\n");
fflush(stdout);
}
int main(int argc, char* argv[])
{
//設(shè)置Control-C的回調(diào)
printf("Want to try Control-C ?\n");
signal(SIGINT, catch_int);
//進(jìn)入循環(huán)
while(1)
pause();
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -