文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C++抛出一个异常

C++抛出一个异常

时间:2010-09-01  来源:riverbird2005

c++抛出异常示例:

//#include <iostream>


//using namespace std;


class MyError {
    const char* const data;
    public:
        MyError(const char* const msg = 0) : data(msg) {}
};

void f() {
    throw MyError("something bad happend");
}

int main()
{
    f();
    return 0;
}


运行结果:
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
Process returned 3 (0x3)   execution time : 0.031 s Press any key to continue.

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载