What are types in C#?

CsharpProgrammingServer Side Programming

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++.

Published on 13-Aug-2018 14:34:28