Data types in C#

In C#, a variable can acquire one of the following types:

  • A value type
  • A reference type

C# differentiates between these two types in terms of how these values are saved and maintained in the Global Assembly Cache (GAC) during the program execution. Value type variables are saved in the stack, while reference type variables are saved in a managed heap data structure.

There are other pointer types that allow us to access value in the memory location of a variable. In Chapter 8, Creating and Using of Types in C#, we will explore those data types in detail. For now, let's look at these two data types and explore them in detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.239.48