CHAPTER 3
Variables
Variables are used for storing data during program execution.
Data types
Depending on what data you need to store there are several different kinds of data types. The simple types in C# consist of four signed integer types and four unsigned, three floating-point types as well as char and bool.
Data Type | Size (bits) | Description |
---|---|---|
sbyteshortintlong | 8163264 | Signed integers |
byteushortuintulong | 8163264 | Unsigned integers |
floatdoubledecimal | 3264128 | Floating-point numbers |
char | 16 | Unicode character |
bool | 4 | Boolean value |
Declaration
In C#, a variable must be declared (created) before it can be used. ...
Get C# Quick Syntax Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.