We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C++
- Classes
- Inherited Code
- Discussions
Inherited Code
Inherited Code
Sort by
recency
|
226 Discussions
|
Please Login in order to post a comment
This is my exception, it doesn't work on random test cases, anyone knows why ?
class BadLengthException: public exception { private: int length;
};
Here is Inherited Code problem solution in C++ - https://programmingoneonone.com/hackerrank-inherited-code-solution-in-cpp.html
I'm also facing this issue on my dunkin donuts menu site.
class BadLengthException{ public: int n; BadLengthException(int e){ n=e; } int what() { return n; } };
If showing error in integer or const something stuffs, just remove the 'const' keyword after as : class BadLengthException : public exception { private: int exceptionname; public: explicit BadLengthException(const int &exceptionexample) { exceptionname = exceptionexample;}