Re: Exception Handling in Release Mode
On 15 f?v, 12:49, "Moahn" <ramamo...@rediffmail.com> wrote:
Hi,
I am learning the Exception Handling in C++. I wrote a small program using
Exception Handling. I am using Vistual Studio 6.
I advise that you upgrade to a compiler conformant to the C++
standard.
It is working fine in Win32 Debug build, but it is not catching the
exception in Win32Release mode.
int main(int argc, char* argv[])
{
int i = 0;
try
{
int m = 17/i;
}
catch(...)
{
cout<<"Main - Catch"<<endl;
}
cout <<"End of Main" <<endl;
return 0;
}
Could you please explain, why the Exception is not caught in the
Win32Release mode.??
This is the expected behaviour.
There is no exception being thrown, therefore there is nothing to
catch.
Division by zero doesn't throw exceptions. It is juste undefined
behaviour.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]