In my c++ code, I have a block of code that gives me an "Access Violation Writing Location ..." Exception when user input is invalid..
I tried to catch this exception in my try/catch block to display error message when the exception occurs.. but for some reason it is not catching the error.
try {
// ... some code that causes Access Violation Writing Location Exception
}
catch (...) {
std::cout << "invalid user input" << endl;
}
I did this, but when the exception occurs, the console does not display my error message, but says there is an
Unhandled exception at 0x0F0B0E9A (msvcr110d.dll) in Example.exe : Access violation writing location
So it seems like my try/catch block is not catching the exception...
I set break points to make sure that the exception is occuring within the try block.. and I'm 100% that's the case..
Why is "catch (...)" not catching the Access Violation exception?