Data Types
An important part in the life of a C# programmer is the management of data types. Just as in C and C++, every variable has a fixed data type. Every data type provides a rich set of operators that can be used to perform a very special operation. Objects can be seen as data types as well, but we'll take a closer look at that later in this book.
Predefined Data Types
C# supports a list of predefined data types. In this section, we examine the most important types. Table 3.1 contains an overview.
C# | MONO | SIGNED | MEMORY | RANGE |
---|---|---|---|---|
sbyte | System.Sbyte | Yes | 1 byte | –128 to 127 |
short | System.Int16 | Yes | 2 bytes | –32768 to 32767 |
int | System.Int32 | Yes | 4 bytes | –2147483648 to 2147483647 |
long | System.Int64 | Yes | 8 bytes | –9223372036854775808 to 9223372036854775807 ... |
Get Mono Kick Start 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.