FlyBoy Posted September 26, 2004 Posted September 26, 2004 there are the "checked" and "unchecked" keywords to identify int overflows... i get the idea of the "checked"..but why do i need the "unchecked"??? isnt the default mode is in "unchecked" mode,i mean when i dont use anything.?? Quote
Administrators PlausiblyDamp Posted September 26, 2004 Administrators Posted September 26, 2004 integer arithmetic inside a checked block will throw an exception if the statement would cause either an overflow or an underflow. unchecked blocks will just wrap round and not generate any errors. The reason both keywords exist is the default behaviour can be set on a project by project basis - and as such you may need to override that behaviour in certain places. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
FlyBoy Posted September 26, 2004 Author Posted September 26, 2004 integer arithmetic inside a checked block will throw an exception if the statement would cause either an overflow or an underflow. unchecked blocks will just wrap round and not generate any errors. The reason both keywords exist is the default behaviour can be set on a project by project basis - and as such you may need to override that behaviour in certain places. i see...10x for the reply! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.