♦ C# Data Types
♣ C# Data Types
Data Types are fundamentally classified based on the amount of memory for each Data Type.Each Data Type has the capability of holding a different type of entity.
Some common occurring Data Types are int, float, string.
♣ Data Types in C#
Below is a tabular explanation of Data Types in C#Data Type | Size | Range |
---|---|---|
int | 4 bytes | -2,147,483,648 to 2,147,483,647 |
long | 8 bytes | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
float | 4 bytes | 6 to 7 decimal digits |
double | 8 bytes | 15 decimal digits |
char | 2 bytes | 255 characters |
string | 2 bytes per character | 2,147,483,647 characters |
bool | 1 bit | true or false |