C# Variable Types (Value Type)

The following table lists, and gives information about, the predefined value types. Because in C# all of the apparently fundamental value types are in fact built up from the (actually fundamental) object type, the list also indicates which System types in the .Net framework correspond to these pre-defined types.

C# Type.Net Framework (System) typeSigned?Bytes OccupiedPossible Values
sbyteSystem.SbyteYes1-128 to 127
shortSystem.Int16Yes2-32768 to 32767
intSystem.Int32Yes4-2147483648 to 2147483647
longSystem.Int64Yes8-9223372036854775808 to 9223372036854775807
byteSystem.ByteNo10 to 255
ushortSystem.Uint16No20 to 65535
uintSystem.UInt32No40 to 4294967295
ulongSystem.Uint64No80 to 18446744073709551615
floatSystem.SingleYes4Approximately ±1.5 x 10-45 to ±3.4 x 1038 with 7 significant figures
doubleSystem.DoubleYes8Approximately ±5.0 x 10-324 to ±1.7 x 10308 with 15 or 16 significant figures
decimalSystem.DecimalYes12Approximately ±1.0 x 10-28 to ±7.9 x 1028 with 28 or 29 significant figures
charSystem.CharN/A2Any Unicode character (16 bit)
boolSystem.BooleanN/A1 / 2true or false

Comments

Popular posts from this blog

മലയാളത്തില്‍ മൊത്തം എത്ര അക്ഷരങ്ങള്‍ ഉണ്ട്?

Convert Number To Words in SQL Sever

Crystal reports load report failed: Could not load file or assembly CrystalDecisions.Web, Version=10.2.3600.0