runntime error

Sep 6, 2009 at 3:30pm
This application has requested the Runtime to terminate it in an unusual way...

Thats the message I get when running my program, maybe someone can say what may be the problem?
Sep 6, 2009 at 3:51pm
Somewhere in your app an exception was thrown, but never got caught.
Sep 6, 2009 at 4:43pm
Yes thats true, this code:

1
2
3
4
catch (...)
{
    cout << "Exception caught!" << endl;
}


caught an exception. But is there a possibility what kind of exception it caugth?
Last edited on Sep 6, 2009 at 4:43pm
Sep 6, 2009 at 5:30pm
Every exception which were thrown by the STL are derived from std::exception, so :
1
2
3
4
catch (const std::exception& x)
{
    cout << "Exception caught : " << x.what() << endl;
}

should tell you what's the problem.
Don't forget to #include <exception>
Topic archived. No new replies allowed.