C# Programming/Keywords/unchecked
Appearance
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.
C# Programming
Cover | Introduction | Basics | Classes | Advanced Topics | The .NET Framework | Index
Cover | Introduction | Basics | Classes | Advanced Topics | The .NET Framework | Index
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) |