I think, it will not be compiler dependent.
Because at run time, we check all the catch blocks sequentially, and as
soon as we find datatype of exception and catch block are same , we
just ignore rest others.
And once catch(...) is found it means you will never check for other
catch blocks. So all compiler will be forcing to write catch(...) in
the last only.
cw***@hotmail.com wrote:
int main()
{
try {
b();
} catch(...) {
return 1;
} catch(int i) {
return 2;
}
what ll happen to this code?
does it always generate syntax error because of the catch(...) phase?
or is it complier specific?
Thanks!