I am currently using Visual Studio Express C ++ 2008, and I have some questions about ordering catch blocks. Unfortunately, I could not find the answer on the Internet, so I ask these questions to experts.
I notice that if catch (...) does not fit at the end of the catch block, compilation will fail with error C2311. For example, the following compilation:
catch (MyException)
{
}
catch (...)
{
}
while the following:
catch (...)
{
}
catch (MyException)
{
}
and. May I ask if this is defined in the C ++ language standard, or if it is just a Microsoft compiler that is strict?
b. Does C # and Java have the same rules?
. catch catch . . , , ?