Learn the Basics about C# Data Types
Data types are used everywhere in a programming language like C,C++,Java,C# . In C# you cannot use variable without data types .Data types tell the compiler that which type of data is used for processing .
For example if you want to work with string value then you will have to assign string type variable to work with. In this article we will discuss some of the most used data types and how they work.
The type of data that a variable contains is called data types .C# is a strongly typed language so every variable and object contain data type .C# provides two types of data type.
- Value Type
- Reference Type
Value type is one of the most commonly used data type in C# .Value type variables can be assigned a value directly.A value type data type stores copy of the value. The value types directly contain data. Some examples are ,
Reference Type :
The reference types do not contain the actual data stored in a variable, but they contain a reference to the variables. Reference type contains a pointer to memory location that holds the data.
Examples of reference types are,