C# 2008 Integer Variable Types

Each variable has a fixed type in C#, and integer (int) variable types are limited to whole numbers. C# has several other integer variable types, shown in this chart:

























































TypeSize (bytes)RangeIn Use
sbyte1-128 to 127sbyte sb = -12;
byte10 to 255byte b = 12;
short2-32,768 to 32,767short sn = -123;
ushort20 to 65,535ushort usn = 123;
int4-2,147,483,648 to 2,147,483,647int n = 123;
uint40 to 4,294,967,295uint un = 123U;
long8-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 -
“a whole lot”
long l = 123L;
ulong80 to 18,446,744,073,709,551,615long ul = 123UL;








dummies

Source:http://www.dummies.com/how-to/content/c-2008-integer-variable-types.html

No comments:

Post a Comment