I use try/catch within a function like this,
I am not able to give a very concrete example since it is too complicated. I just expect to get some clues. Basically there is an exception in the statement within try(I am sure there is one). But to my surprise catch(...) couldn't catch any exception. But the caller of the function foo catches an exception from the statement within the try like the following. I set enabling exception in visual studio and also set option to SH/a.Code:void foo() { ... try{ ... } catch(...) { } ... }
Here an exception is caught. But my understanding is that since try within the function foo is inner try, so an exception should be caught by it instead of try used in the function bar(). Can any guru here give me some clues how it happens? Thanks.Code:void bar() { try{ foo(); { catch(...) { } }




Reply With Quote