CSharpVariablesTutorialDocumentation
CSharpVariablesTutorialDocumentation
C# Variables
C# for Beginners
Type C# Keyword .Net Type Range Size Precision
Value Types
Byte byte System.Byte 0 to 255 Unsigned 8 bit integer
sByte sbyte System.SByte -128 to127 Signed 8 bit Integer
Short Integer short System.Int16 -32678 to 32677 Singed 16 bit Integer
uShort ushort Systen.UInt16 0 to 65355 Unsigned 16 bit Integer
Integer int System.Int32 -2,147,483,648 to 2,147,483,647 Signed 32 bit Integer
uInt System.UInt32 0 to 4,294,967,295 Unsigned 32 bit Integer
-9,223,372,036,854,775,808 to
Long Integer long System.Int64 Signed 64 bit Integer
9,223,372,036,854,775,807
uLong System.UInt64 0 to 18,446,744,073,709,551,615 Unsigned 64 bit Integer
Float float System.Single ±1.5 x 10−45 to ±3.4 x 1038 32 bit floating point value ~6-9 digits
Double double System.Double ±5.0 × 10−324 to ±1.7 × 10308 64 bit floating point value ~15-17 digits
28-29 significant
Decimal decimal System.Decimal ±1.0 x 10-28 to ±7.9228 x 1028 128 floating point value
digits
Boolean bool System.Boolean true/false 8 bits
Character char System.Char 16 bit unicode value
Enum enum
Struct struct
Datetime datetime System.DateTime 64 bit Integer
Reference Types
String string System.String
Object object System.Object
Dynamic dynamic
Delegate delegate
Class class
Array Array
Int32
This integer data type is a 32 bit data type.
It is a signed data type which means it supports both positive and negative
values.
This data type supports a range from, -2147483648 to 2147483647.
The integer data type has an unsigned counter part named uInt. Unsigned
means it only supports positive values.
uInt supports a range of positive whole number values between
0 to 4294967295.
An integer is a value type.
String
Internally a string object stores a read-only sequence of char objects.