Home » Community » Newbie corner » does u++ not support C++ exception ???
|
Re: does u++ not support C++ exception ??? [message #39185 is a reply to message #39184] |
Mon, 25 February 2013 10:55 |
|
porschee wrote on Mon, 25 February 2013 10:03 | Code as follows :
int x = 0 ;
try
{
int y = 100 ;
int z = y/x ;
}
catch(...)
{
PromptOK("Exception ...");
}
but catch(...) can not catch
????
|
Hi porschee,
Welcome to the forums
U++ does support exceptions.
The division by zero does not result in an exception in standard C++. According to standard:Quote: | If the second operand of / or % is zero, the behavior is undefined.
| You need to check the value yourself and throw exception if desired...
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Fri Apr 19 13:44:45 CEST 2024
Total time taken to generate the page: 0.02622 seconds
|