What are types in C#?


The types in C# include the following −

Value Types

Value type variables can be assigned a value directly. They are derived from the class System.ValueType.

The value types directly contain data. Some examples are int, char, and float, which stores numbers, alphabets, and floating point numbers, respectively. When you declare an int type, the system allocates memory to store the value.

Reference Types

The reference types do not contain the actual data stored in a variable, but they contain a reference to the variables.

Pointer Types

Pointer type variables store the memory address of another type. Pointers in C# have the same capabilities as the pointers in C or C++.

Updated on: 21-Jun-2020

76 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements