C ++ - abnormal

1.throw expression

IF (! item1.isbn () = item2.isbn ())
     the throw a runtime_error ( " Data MUST REFER to ISBN The Same " );
 // perform this, ISBN represents two same 
cout << item1 + item2 << endl;

 

2.try statement block


    
n')   break;//out of while   } }

 

3. Exception class

3.1 exception Exception class: the most common problems reported

3.2 new header --bad_alloc abnormal

3.3 type_info header --bad_cast abnormal

3.4 stdexcept header file 

 

Guess you like

Origin www.cnblogs.com/yrm1160029237/p/11409595.html