c++异常捕获例子
来源:互联网 发布:淘宝公益广告联盟 编辑:程序博客网 时间:2024/05/08 16:05
15 #include<iostream>
16 using namespace std;
17 int main()
18 {
19 int i=0,j=0,h=0;
20 i=100;
21 int*p=NULL;
22 try
23 {
24 if(p==NULL)throw exception ();
25 h=*p;
26 }
27 catch(...)
28 {
29 cout<<"cjj error!"<<endl;
30 }
31 return 0;
16 using namespace std;
17 int main()
18 {
19 int i=0,j=0,h=0;
20 i=100;
21 int*p=NULL;
22 try
23 {
24 if(p==NULL)throw exception ();
25 h=*p;
26 }
27 catch(...)
28 {
29 cout<<"cjj error!"<<endl;
30 }
31 return 0;
32 }
[root@pa137 test]# g++ main.cpp
[root@pa137 test]# ./a.out
cjj error!
[root@pa137 test]#
- c++异常捕获例子
- 捕获异常消息Ctrl+C
- C++assert和捕获异常
- GWT 类的未捕获异常例子
- 一个例子明白抛出与捕获异常
- More Effective C++:通过引用捕获异常
- More Effective C++:通过引用捕获异常
- C#_WinForm 统一捕获未处理的异常
- OBject-C捕获异常,常用的异常处理方法
- 【C++】try 语句捕获异常,catch子句处理异常
- 异常捕获
- 捕获异常
- 异常捕获
- 捕获异常
- 异常捕获
- 异常捕获
- 捕获异常
- 捕获异常
- Oracle存储过程中跳出循环的写法
- CSDN再来的感悟
- objdump 反汇编一个函数的脚本
- oracle存储过程学习笔记1–基本结构
- 使用common-fileupload实现文件的上传
- c++异常捕获例子
- QT编程中遇到的问题总结
- I/O流使用小细节
- html tips
- silverlight中ItemsSource和DataContext的用法区别
- Shell脚本语法
- Linux内核的同步机制:原子操作
- LTRIM、RTRIM和TRIM在ORACLE中的用法:
- Redhat Enterprise Linux与CentOS的区别