{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

c++12 - C C cfw_c cfw c cfw X C cfw_X 2 C cfw_U cfw_U f cfw...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
@ Ž C++ ¸ ë ²´ ª*
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 C++ ª* ° C++ ° X { * ±± ± ° · /
Background image of page 2
3 C++ + f() ˜ \{ ¸ ª* h() g() …… ˜ \ {¸ª*
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 C++ * ...... throw ; ...... ° u ¿ try catch øoe†μ ª * catch øoe†μ ª *
Background image of page 4
5 C++ °0> μ * throwð w ¬ * ð w * tryð w * try ¸ \ { ¸ * try ¸ \ { ¸ * °¹úμ ¥ /p¬ * ¬ try catch X try X catch ¸ \ { ¸ ª * ¸ \ ª * catch ¸ \ { ¸ ª tryð * catch ˜ñ *p ›† μ ª*° ˜ñ w *p ›† μ ª*° terminate¸ \ { ¸ ª* ¸ \ { ¸ ª* abort ¸ \ { ¸ ª
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
6 C++ + 12-1 x ² ³ ´ ª* #include<iostream.h> int Div(int x,int y); int main() { try { cout<<"5/2="<<Div(5,2)<<endl; cout<<"8/0="<<Div(8,0)<<endl; cout<<"7/1="<<Div(7,1)<<endl; } catch(int) { cout<<"except of deviding zero.\n"; } cout<<"that is ok.\n"; } int Div(int x,int y) { if(y==0) throw y; return x/y; } 0 5/2=2 except of deviding zero. that is ok.
Background image of page 6
7 C++ ª* ¥ /p¬ * ¬ * + void fun() throw(A B C D); ° ¹úμ * ᥠ/p¬ * ¬ ˜ ñw * `ûd´ª * ° void fun() throw();
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8 C++ øPØ * catch L a { L a { * L a { try °°° ± ° È 1¿ º ± æ– w * i{ ¸ª*° ¹ú L a { catch °°°°° È 1¿
Background image of page 8
9 C++ + 12-2 o U { * #include <iostream.h> void MyFunc( void ); class Expt { public: Expt(){}; ~Expt(){}; const char *ShowReason() const
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 10
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 12
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 14
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}