Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original
test.c #include <exception> #include <iostream> #include <string> class ClassTwo : public std::exception { std::string _msg; public: Exception(const std::string& msg) : _msg(msg){} virtual const char* what() const noexcept override { return _msg.c_str(); } }; class Exception : public std::exception { std::string _msg; public: Exception(const std::string& msg) : _msg(msg){} virtual const char* what() const noexcept override { return _msg.c_str(); } }; int main() { try { throw Exception("Something went wrong...\n"); } catch(Exception& e) { std::cout << e.what() << std::endl; } } test.cbp test.layout