Windows10 VS2017 C++信号处理
#include "pch.h"
#include <iostream>
#include <csignal>
#include <windows.h>
using namespace std;
int i;
void signalHandle(int signum)
{
cout << "Interrupt signal(" << signum << ")received" << endl;
i = signum;
}
int main()
{
//注册信号以及信号处理程序
signal(SIGINT, signalHandle);
while (1)
{
if (i == 2)
{
break;
}
cout << "hello..." << endl;
Sleep(1000);//暂停1s
}
system("pause");
return 0;
}
参考
https://blog.csdn.net/qq_28796345/article/details/51290493
Windows10 VS2017 C++信号处理的更多相关文章
- Windows10 VS2017 C++编译Linux程序
#include <cstdio> #include <iostream> #include "unistd.h" using namespace std; ...
- Windows10 VS2017 C++使用crypto++库加密解密(AES)
参考文章: https://blog.csdn.net/tangcaijun/article/details/42110319 首先下载库: https://www.cryptopp.com/#dow ...
- Windows10+VS2017 用GLFW+GLAD 搭建OpenGL开发环境
本文参考:https://learnopengl-cn.github.io/ 一 下载GLFW(https://www.glfw.org/download.html) 和 GLAD(https:// ...
- Windows10 VS2017 C++多线程传参和等待线程结束
#include "pch.h" #include <iostream> #include <windows.h> using namespace std; ...
- Windows10 VS2017 C++模拟点击按键
#include "pch.h" #include <Windows.h> #include <stdio.h> #include <iostream ...
- Windows10 VS2017 C++ ini解析(使用simpleini头文件)
simpleini项目地址: https://github.com/brofield/simpleini 下载,新建项目,并将SimpleIni.h文件通过包含目录的方式加载进来. 创建test.in ...
- Windows10 VS2017 C++ xml解析(tinyxml2库)
首先下载tinyxml2 7.0.1库: https://github.com/leethomason/tinyxml2/releases 打开tinyxml2,然后升级sdk,解决方案->重定 ...
- Windows10 VS2017 C++ Json解析(使用jsoncpp库)
1.项目必须是win32 2.生成的lib_json.lib放到工程目录下 3.incldue的头文件放到工程目录,然后设置工程->属性->配置属性->vc++目录->包含目录 ...
- Windows10 VS2017 C++ Server Socket简单服务器端与客户端
服务端: #include "pch.h" #include<iostream> #include<WinSock2.h> #include <Ws2 ...
随机推荐
- 面向对象select方法
<?php class Table{ protected $tablename; protected $arrTable; protected $w ...
- Centos安装Python各版本解释器并配置pip
Centos7.3安装Python3.7 Python3.7貌似又多了新的依赖,所以按照安装之前的套路安装在配置pip阶段就会出问题,比如: ModuleNotFoundError: No modul ...
- Shell 文本处理命令
命令:cut –d’:’ -f1, 文件名 #切割处文件列的参数. -d切割字符. -f列的第几个参数. -c1-10指定字符串范围行的第一个到第十个. 命令:sort 文件名 #根据第一列第一个字符 ...
- Linux-Centos7 安装图形界面
1.首先安装X(X Window System),命令为 :yum groupinstall "X Window System" 回车(注意有引号) 2.查看桌面列表 : yum ...
- How to fix TFS workspace mapping error in Jenkins
Once you had update in TFS workspace for Jenkin TFS plugin, you might get error like bellow: [worksp ...
- linux解压类型总结
1.*.tar 用 tar –xvf 解压2.*.gz 用 gzip -d或者gunzip 解压3.*.tar.gz和*.tgz 用 tar –xzf 解压4.*.bz2 用 bzip2 -d或者用b ...
- 放大镜jQuery效果
今天我们来写一下jQuery的效果来上代码 1,html代码 <div id='small'><img src="./icon/images/sj1.jpg" a ...
- map的循环删除操作
1.错误示例 Map<String,InterfaceOutParam> outCodes1 = outParamList.stream().collect(Collectors.toMa ...
- Linux下Java环境安装
本节主要讲解Linux(Centos 6.5)下Java环境的安装 1. 卸载机器上默认安装的JDK 在Linux环境下一般会默认安装jdk,为了自己项目的开发部署,一般情况要重新装jdk,而且自己装 ...
- 雷林鹏分享:jQuery EasyUI 数据网格 - 创建自定义视图
jQuery EasyUI 数据网格 - 创建自定义视图 在不同的情况下,您可能需要为数据网格(datagrid)运用更灵活的布局.对于用户来说,卡片视图(Card View)是个不错的选择.这个工具 ...