g++ 4.01
Suse Linux 9
i486
Try-Catch blocks seem to work when I issue a throw. However, they do not catch illegal statements such as divide by zero, or segmentation faults. For example,
Code: CPP
try{
throw 1;
}
catch (...) {
cout<<"Exception caught!"<<endl;
}
HOWEVER
Code: CPP
try{
int a=1, b=0;
a=a/b;
}
catch (...) {
cout<<"Exception caught!"<<endl;
}
Am I missunderstanding C++ exception handling, or should the second example be caught? I've tried different complier options (-O0 and -O1), and (-fexceptions) with the same results.
Thanks,
Dan

