virtual const char* what() const throw()
{
}
AFAIK it\'s a function that will return a constant pointer to a mutable char. The rest I am not sure.
virtual this one is used to overridden in derived class from base class const char* This is a pointer to a constant characterwhat Returns a null-terminated character sequence that may be used to identify any exception throw() parameter inside the throw is empty so it will call std::unexpected for all exception#include
#include
class Myexception:public exception
{
virtual const char* what() const throw()
{
return "My exception here";
}
} myex;
int main()
{
try()
{
throw myex;
}
catch(exception &e)
{
cout<