You are viewing a single comment's thread. Return to all comments →
why did you define stringstream variable inside the constructor? and Why cant I define ss as a class variable, inside the private block ?
class BadLengthException: public exception{ stringstream ss; string error; public: BadLengthException(int n) { ss<<n; error = ss.str(); } virtual const char* what() const throw() { return error.c_str(); } };
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 →
why did you define stringstream variable inside the constructor? and Why cant I define ss as a class variable, inside the private block ?