What is the difference between checked and unchecked?

Difference Engine picture Difference Engine · Sep 22, 2010 · Viewed 9.4k times · Source

What is the difference between

checked(a + b)

and

unchecked(a + b)

?

Answer

Steve Guidi picture Steve Guidi · Sep 22, 2010

Those are operators that check (or do not check) for overflow in the resulting numerical operation. In the checked case, an OverflowException exception is raised if the result of the operation exceeds the minimum or maximum value allowed for the datatype.

More information is available from MSDN.