SN> What are exceptions and what do they have to do with C++? What
SN> are they used for?
Hola amigo!
Exceptions are a very elegant method of error returning and handling
in C++. They eliminate the need for functions to return error codes.
Returning error codes is messy, since if function a calls function b
calls function c then c must return an error code. Then b must check
for the return code from c and return it to a. Finally a must handle
the error code. Exceptions allow c to "throw" an error rather than
return one. The "catch" statement handles the error without any help
from the intervening functions. Decribing exceptions is beyond the
scope of a simple email message. I humbly suggest you get the latest
edition of "The C++ Programming Language" by Bjarne Stroustrup.
Sincerely,
Pete
--- Platinum Xpress/Win/Wildcat5! v2.0
---------------
* Origin: St. Louis Users Group (1:100/4)
|