setjmp与longjmp的使用
来源:互联网 发布:淘宝秒杀输入验证码 编辑:程序博客网 时间:2024/05/16 10:14
#include "stdafx.h" #include #include #include using namespace std; jmp_buf g_objJmp; void fun(); int main() { while (true) { switch (setjmp(g_objJmp)) { case -1: cout << "stop process err!" << endl; return -1; case 0: //run ok cout << "run succ" << endl; break; case 1: cout << "err 1" << endl; break; case 2: cout << "err 2" << endl; break; default: cout << "unknow err!" << endl; break; } Sleep(1000); fun(); } } void fun() { static int nTimes = 0; cout << "run times: " << nTimes << endl; int nVal = rand() % 3 + 1; nTimes++; if (10 == nTimes) { nVal = -1; } longjmp(g_objJmp, nVal); } 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/andylin02/archive/2009/11/30/4905856.aspx
- setjmp与longjmp的使用
- 全面了解setjmp与longjmp的使用
- 全面了解setjmp与longjmp的使用
- 全面了解setjmp与longjmp的使用
- 全面了解setjmp与longjmp的使用
- 全面了解setjmp与longjmp的使用
- 全面了解setjmp与longjmp的使用
- 全面了解setjmp与longjmp的使用
- 全面了解setjmp与longjmp的使用
- setjmp和longjmp的使用
- setjmp和longjmp的使用
- setjmp和longjmp的使用
- 关于setjmp longjmp的使用
- setjmp和longjmp的使用
- 转贴 全面了解setjmp与longjmp的使用
- C++语言中使用setjmp与longjmp的注意点
- [转]全面了解setjmp与longjmp的使用
- [转]全面了解setjmp与longjmp的使用
- C#接口
- How to show line number in eclipse
- test
- ROBOCOPY.exe (XP Resource Kit/Standard Windows7 and Server command)
- 全面了解setjmp与longjmp的使用
- setjmp与longjmp的使用
- 常用正则表达式(包括中文匹配)匹配中文正则表达式
- 不用关闭子界面查看父窗体datagrid
- Git Reference
- ext combo 记录
- JAVA MD5算法应用
- 用Doctype激活浏览器模式(Activating Browser Modes with Doctype) (二)
- 【mysql】数据库备份
- IE6 图片显示最大设置