Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Exception h...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 9551 of 9823
Post > Topic >>

Re: Exception handling

by Otis Bricker <obricker@[EMAIL PROTECTED] > Apr 27, 2008 at 03:45 PM

=?UTF-8?B?RXJpayBXaWtzdHLDtm0=?= <Erik-wikstrom@[EMAIL PROTECTED]
> wrote in
news:aYWQj.6627$R_4.5224@[EMAIL PROTECTED]
> On 2008-04-27 00:29, howa wrote:
>> Hi,
>> 
>> I have simple code which provide exception handling functions, e.g.
>> 
>> //---------------------------------
>> try {
>>           int j = 2;
>>           int k = 0;
>>           double t = j / k;
>> 
>>      } catch (...) {
>>           cout<<"Error!";
>>      }
>> 
>> //---------------------------------
>> 
>> VS.net told me "unhandled exception".
>> 
>> But isn't catch (...) will cover as the default handler?
> 
> Division by zero does not throw an exception (in standard C++). MS have
> some private extensions which can throw a structured exception in this
> case but those are not (as far as I know) C++ exceptions and can not be
> caught with catch().
> 

I believe that compiler offeres the option to handle them as C++
exceptions. Sorry, I am not sure what version you are using but check for
the /EHa compiler flag in the do***entaion.

And I think that as others have said or at least implied, this will be
non-
standard behavior.

Otis

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 6 Posts in Topic:
Exception handling
howa <howachen@[EMAIL   2008-04-26 16:29:41 
Re: Exception handling
=?ISO-8859-1?Q?Daniel_Kr=  2008-04-27 07:03:10 
Re: Exception handling
Thomas Maeder <maeder@  2008-04-27 07:29:53 
Re: Exception handling
=?UTF-8?B?RXJpayBXaWtzdHL  2008-04-27 07:44:29 
Re: Exception handling
Otis Bricker <obricker  2008-04-27 15:45:51 
Re: Exception handling
Pavel Minaev <int19h@[  2008-04-27 15:46:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 1:49:43 CDT 2008.