"AliRezaGoogle" <as*******@yahoo.comwrote in message
news:0f**********************************@x35g2000 hsb.googlegroups.com...
Dear Members
Hi,
I have a question:
Why doesn't "checked" work for sub calls?
A fairly complex path could be created if allowed.
Imagine something like this:
public static void Main()
{
checked
{
RunProgram();
}
}
Can you imagine the overhead with this? Ouch!
For example consider the
following snippet of code:
checked
{
Overflower();
}
void Overflower()
{
int t=int.MaxValue;
t++;
}
Why Overflower doesn't throw overflow exception?
Because it is not checked.
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#
or just read it:
http://feeds.feedburner.com/GregoryBeamer
********************************************
| Think outside the box! |
********************************************