📄 singal.c
字号:
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
void catch_int(int sig_num)
{
// 重新设置 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[])
{
//设置Control-C的回调
printf("Want to try Control-C ?\n");
signal(SIGINT, catch_int);
//进入循环
while(1)
pause();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -