TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: SEBASTIAN NOZZI
from: PETER GARNER
date: 1998-03-28 00:31:00
subject: Exceptions

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.