// 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;
}