const char* exception::what(const_iterator qIter) const;
#include <exception>
#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;
}
© 20072025 XoaX.net LLC. All rights reserved.