For value types, the variable contains the value itself, but for reference types, the object goes into the heap (managed memory space), and the variable contains a link pointing to the beginning of the memory block used to store the object.
The size of the pointer is determined by your system, on a 32-bit system, the reference pointer is 4 bytes, and for a 64-bit system, the pointer will be 8 bytes.
Since reference types require this overhead for each object, it is recommended that you specify a type that you are likely to create many times, for example Point , which is used in any paint program, you must make them value types using struct .
theburningmonk
source share