What’s the difference between struct and class in .NET?

In .NET, there are two categories of types, reference types and value types. Structs are value types and classes are reference types. The general difference is that a reference type lives on the heap, and a value type lives inline, that is, wherever it is your variable or field is defined. A variable containing a value type contains the entire value type value. For a struct, that means that … Read more