Translate

Wednesday, August 29, 2012

C# Data Types or Data Types in C#

C# Data Types or what are Data Types in C#


A variable holds data that has a specified type. When we declare a variable to store data in an application, we are required to choose an appropriate data type for that data to hold.
It is known that C# is a type-safe language, which means that the compiler guarantees that values that are stored in variables are always of the appropriate type.

Frequently Used Data Types
The following table shows the frequently used data types in C#, and their characteristics.

Type
Size
Range
Description
Long
8
–2,147,483,648 to 2,147,483,647
Number with big range
Int
4
–9,223,372,036,854,775,808 to
9,223,372,036,854,775,807
Whole Number
Float
4
+/–3.4 × 10^38
Float
Double
8
+/–1.7 × 10^308
Double
precision
(more
accurate)
floatingpoint
numbers
Decimal
16
28 significant figures
Decimal values
String
2 per character
There is no limit
List of characters
DateTime
8
0:00:00 on 01/01/0001 to 23:59:59 on
12/31/9999
Date and time

1 comment:

  1. Net grid is a very useful and easily understandable tutorial which is very helpful visit dapfor. com

    ReplyDelete