Creating Value Types
The .NET framework recognizes two distinct families of types: value types and reference types.
Value types are relatively simple, small structures that can be created and used directly on the stack. Reference types are essentially objects in their own right, are created on the managed heap, and are subject to Garbage Collected lifetime management.
A value type might be a simple storage type such as an int or a float. It could also be a small structure or class such as time_t or CPoint. A reference type is a class, an interface, an array, and so forth.
Value types created and used on the stack are not subject to GC management because they are effectively deleted by the movement of the stack pointer when they go out of scope. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access