Jump to content
Wikibooks The Free Textbook Project

C# Programming/Keywords/unchecked

From Wikibooks, open books for an open world
The latest reviewed version was checked on 16 April 2020. There are template/file changes awaiting review.

The unchecked keyword prevents overflow-checking when doing integer arithmetics. It may be used as an operator on a single expression or as a statement on a whole block of code.

intx,y,z;
x=1222111000;
y=1222111000;
// used as an operator
z=unchecked(x*y);
// used as a statement
unchecked{
z=x*y;
x=z*z;
}



C# Keywords
Special C# Identifiers (Contextual Keywords)
Contextual Keywords (Used in Queries)

AltStyle によって変換されたページ (->オリジナル) /