1613-3-傅溥衍 总结《2016年12月8日》【连续第六十九天总结】

来源:互联网 发布:英文名软件 编辑:程序博客网 时间:2024/04/29 05:01
标题:模板和异常处理
关键词:异常处理
内容: 
A今日完成情况

1. 异常处理30%


B具体内容

#include<iostream>using namespace std;int main(){try{cout<<"this is a test"<<endl;throw 1;cout<<"it can not show"<<endl;}catch(char){cout<<"********"<<endl;}catch(int a){cout<<"+++++++++"<<endl;cout<<"a="<<a<<endl;}catch(...){cout<<"catch all type";}cout<<"test is end"<<endl;}


#include<iostream>using namespace std;int main(){try{try{throw 'a';cout<<"firt"<<endl;}catch(char){throw;cout<<"second"<<endl; }}catch(...){cout<<"抛出异常"<<endl;}}


C明日计划

A 异常处理

0 0
原创粉丝点击