DIR Return Create A Forum - Home
---------------------------------------------------------
gworld
HTML https://gworld.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: C++PROGRAMMING LANGUAGE
*****************************************************
#Post#: 131--------------------------------------------------
C++ EXCEPTIONS
By: eba95 Date: July 30, 2010, 8:54 pm
---------------------------------------------------------
Handling
The < e x c e p t i on> header provides
functions and classes for exception
control. One basic class is
e x c e p t i on:
c l a s s e x c e p t i on
{
pub l i c :
e x c e p t i on ( ) t h r o w ( ) ;
e x c e p t i on ( c on s t e x c e p t i on & ) t h r o w ( ) ;
e x c e p t i on & ope r a t o r = ( c on s t e x c e p t i on &
) t h r o w ( ) ;
v i r t ua l ~ e x c e p t i on ( ) t h r o w ( ) ;
v i r t ua l c on s t c ha r * w ha t ( ) c on s t t h r o w ( )
;
} ;
Standard Exceptions
The < s t de x c e p t > header provides
a small hierarchy of exception
classes that can be thrown or caught:
e x c e p t i on
l og i c _ e r r o r
do m a i n _ e r r o r
i nv a l i d _ a r gu m e n t
l e ng t h _ e r r o r
ou t _ o f _ r a nge
r un t im e _ e r r o r
r a nge _ e r r o r
ov e r f l o w _ e r r o r
unde r f l o w _ e r r o r
Logic errors are thrown if the
program has internal errors that are
caused by the user of a function and
that, in theory, are preventable.
Runtime errors are thrown if the
cause is beyond the program and
can't be predicted by the user of a
function.
*****************************************************