You are viewing a single comment's thread. Return to all comments →
following makes use of sstream. No need to create object on heap:
const char* what() const throw() { stringstream ss; string error; ss << n; //Integer passed to exception object error = ss.str(); return(ss.c_str()); }
This makes use of "c_str()" which converts your std::string to const char* (which is what c syntax for representing strings)
Seems like cookies are disabled on this browser, please enable them to open this website
Inherited Code
You are viewing a single comment's thread. Return to all comments →
following makes use of sstream. No need to create object on heap:
This makes use of "c_str()" which converts your std::string to const char* (which is what c syntax for representing strings)