![]() |
|
Datatypes used in C#, Free online C# Programming Tutorial... |
| Lessons | C# Datatypes |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1. Reference Types 2. Value Types Value types include the built-in or the primitive data types plus enums and structs, while the reference types, like in Java and C++ are objects of a class and arrays. As mentioned earlier, C# is a type-safe language. Variables can hold either value types or reference types, or they can be pointers. When a variable "a" is a value type, it directly contains the value and when it is a reference type, it contains a reference or address of the object lying somewhere in the heap area of the memory. Built-in Types: The following table lists the built-in C# types and their ranges:
We will continue our discussion on C# data types in the next lesson.
Next >>> Lesson No. 6: C# Datatypes 2
|