What is the difference between value types and primitive types?
A value type is usually whatever type reside on the Stack .
A primitive type is a type defined at the programming language level, often it is even a value type, directly supported by the compiler of the language.
However this is a summary general answer because each programming language have different set of differences between the two types ...
A primitive type (e.g. int
) can be mapped directly to a Base Class Library (BCL) type (e.g. System.Int32
)
A value type inherits from System.ValueType
and is passed by value (among other properties).
They are not interchangeable as object
(System.Object
) is a primitive type but not a value type, and structs are value types but not primitive.
See more differences here