Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Exceptions Questions

Posted on 2006-04-24
4
Medium Priority
?
224 Views
Last Modified: 2010-04-01
It appears that the what() function is a member of the <exception> class. I have seen several other exceptions classes simply inherits the exeception class and then overrides the what() as virtual what().
But I have seen  the docs of the std. <exception> template functions and I do not see a what() there.
Anyone knows if what() is really a member of the <exception> OR is it inherits from some other class?.

I am coming from a Java background and writing some C++ code. One thing....Nothing to beat Javadocs style Java documemtation. C++ is no where near. Sorry. I am not bashing.

I home someone will point me to some place on the web or throw his/her two cents on this.

-prain
0
Comment
Question by:prain
2 Comments
 
LVL 15

Accepted Solution

by:
efn earned 300 total points
ID: 16531056
The what function is a member of the std::exception class declared in the <exception> header file.  This is specified in section 18.6.1 of the C++ standard.  The function is declared like this:

virtual const char* what() const throw();

You can read about it in this tutorial:

http://www.cplusplus.com/doc/tutorial/exceptions.html
0
 
LVL 17

Expert Comment

by:rstaveley
ID: 16532857
> Nothing to beat Javadocs style Java documemtation

Agreed. C++ has a poor cousin of Javadoc called Doxygen, but I've yet to see it applied to the standard libraries. If it was adopted in the drafting of the C++ standard, it might be more widley used in standard library implementations and indeed 3rd party libraries, but the standard was drafted by a committee and it took long enough to draft without needing to reach a concensus about documentation.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question