Chinaunix首页 | 论坛 | 博客
  • 博客访问: 173245
  • 博文数量: 47
  • 博客积分: 3053
  • 博客等级: 少校
  • 技术积分: 451
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-01 04:33
个人简介

malware/APT detection, silicon valley, entrepreneur, CTO, start-up operation, team build, Nanjing/Beijing, if you want to do creative things, join the adventure.

文章分类

全部博文(47)

分类: C/C++

2008-05-01 07:20:46


#include <iostream>

using namespace std;

int handleException(int);

int main(int argc, char** argv){
    int n[] = {1,2,3,4,5};

    try{
        cout << "in try block\n";
        throw 123.9;

        cout << "never go here";
    }catch(int i){
        cout << "int catch block: " << i << endl;

    }catch(char c){
        cout << "char catch block: " << c << endl;

    }catch(...){
        cout << "catch all exception" << endl;
    }

    try{
        handleException(10);

    }catch(char* str){
        cout << "char* exception: "<< str << endl;

    }catch(int i){
        cout << "int exception: "<< i << endl;
    }

    return 0;
}


int handleException(int i) throw(int, char, double)
{
    throw ;
}

阅读(1094) | 评论(0) | 转发(0) |
0

上一篇:Basic I/O

下一篇:PSP Game List in Beijing

给主人留下些什么吧!~~