What is the difference between value types and reference types in C#?
A value type (struct, int, bool, enum) holds its data directly and gets copied on assignment; a reference type (class, string, arrays) holds a pointer to data on the heap, and assignment copies the pointer, not the object. Passing a struct into a method that mutates it silently operates on a copy unless you pass it by ref. A struct stored in a field of a class lives on the heap right there with it, not on the stack.