C++抛出异常exception
来源:互联网 发布:淘宝男装店铺名字 编辑:程序博客网 时间:2024/06/03 18:14
// testMyException.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
try
{
//cout<<"1、send int exception"<<endl;
//throw(10);
cout<<"2、send char exception"<<endl;
//throw('d');
//cout<<"3、send other exception"<<endl;
//throw(2.3);
// 4、也可以定义一个类,将类对象(或类地址,或类指针抛出去)
}
catch(int a)
{
cout<<"1、catch int value is "<<a<<endl;
}
catch(char a)
{
cout<<"2、catch char value is "<<a<<endl;
}
catch(...)
{
cout<<"3、catch ... "<<endl;
}
system("pause");
return 0;
}
0 0
- C++抛出异常exception
- iOS objective-c之-4:异常捕捉(exception)异常抛出
- throw new Exception抛出异常的接收
- [Java] throw Exception 声名抛出异常
- 抛出exception
- Exception异常类(C#)
- 通过spring的aop统一拦截Exception抛出自定义异常
- Dubbo抛出自定义异常时报:Got unchecked and undeclared exception
- java抛出异常try{} catch{}与 throws Exception
- java中的throw new Exception();和throw e;异常抛出
- Spring 事物抛出Exception 异常时事物没有回滚
- Oracle PLSQL Exception异常分类、异常抛出、异常处理、异常传播
- c抛出异常给java处理
- c系列之异常的抛出
- C++:抛出异常与类的引用
- Objective-C - 异常处理(Exception)
- Objective-C - 异常处理(Exception)
- Objective-C - 异常处理(Exception)
- C++总结
- 软考-系统开发与软件工程
- DSP学习总结——McBSP
- Base64加密与解密
- 【BZOJ】1061 [Noi2008]志愿者招募 最小费用最大流——预流&填坑
- C++抛出异常exception
- 配置TOMCAT----- 修改默认ROOT路径
- C list 函数介绍
- iOS8/iOS7对比有什么变化?
- Optimizing Item Import Performance in Oracle Product Hub/Inventory
- 修改Tomcat默认编码解决中文传值乱码问题
- QBC 多条件模糊查询 或(OR) 查询
- 拓扑排序 HDU 2647
- 将h.264视频流封装成flv格式文件(一.flv格式)