You are viewing a single comment's thread. Return to all comments →
Please pay attention that solutions from previous comments produce expected result but are bad.
class BadLengthException: public exception { int N; public: BadLengthException(int N){this->N = N;} int what(){return N;} };
According to standard class std::exception has the next method what()
virtual const char* what() const noexcept; // C++11
And compile produces reasonable error for this:
int what() const noexcept; // C++11
solution.cc:13:9: error: conflicting return type specified for ‘virtual int BadLengthException::what() const’ int what() const*
So I suppose that author expected int->string conversion (see sstream header) but it is another question.
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 →
Please pay attention that solutions from previous comments produce expected result but are bad.
According to standard class std::exception has the next method what()
And compile produces reasonable error for this:
So I suppose that author expected int->string conversion (see sstream header) but it is another question.