exception::exception();
#include <exception>
exception::exception(const exception& kqrCopy);
#include <iostream> #include <exception> void ThrowException() throw(std::exception) { throw std::exception(); } int main() { using namespace std; // The try-catch block allows us to handle exceptions try { // Call a function to throw an exception ThrowException(); } catch(const std::exception& kqrException) { cerr << "Message: " << kqrException.what() << endl; cerr << "Type: " << typeid(kqrException).name() << endl; } // Keep the window open std::cin.get(); return 0; }
© 20072024 XoaX.net LLC. All rights reserved.