M
Michael Satterwhite
I haven't programmed C++ in years, so please forgive this very simple
question.
In function A i have:
void A(int l) {
if(l == 0)
throw "This is a simple exception";
...
In function B I have
try {
A(0);
}
catch (char * s) {
<do something>
}
catch (...) {
<do something else>
}
The general exception handler receives control every time (FWIW, I'm using
gcc in Linux). If I remove the general exception handler, the program
aborts.
Question: Why isn't the (char *s) handler being activated. I know I'm
missing the obvious.
Thanks in advance
question.
In function A i have:
void A(int l) {
if(l == 0)
throw "This is a simple exception";
...
In function B I have
try {
A(0);
}
catch (char * s) {
<do something>
}
catch (...) {
<do something else>
}
The general exception handler receives control every time (FWIW, I'm using
gcc in Linux). If I remove the general exception handler, the program
aborts.
Question: Why isn't the (char *s) handler being activated. I know I'm
missing the obvious.
Thanks in advance