Articles → CSHARP → Is Struct A Value Type Or Reference Type
Is Struct A Value Type Or Reference Type
How Does Value Type Work?
Example
Book a = new Book();
Book b = a;
if (Object.ReferenceEquals(a, b)) {
Console.WriteLine("Both objects are pointing to same location");
}
else {
Console.WriteLine("Both objects are pointing to different location");
}
Click to Enlarge