C# Programming/Keywords/unchecked
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.
int x, 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) | |||||||||||||||
|