I am curious about the string and primitive types. Article like this says string is primitive type. However second article on MSDN does not list string as primitive type. >
In c# the types are primarily defined as two types: value types and primitive types.
First see the definition of primitive types in C#.
On the other hand, all primitive data types in C# are objects in the System namespace. For each data type, a short name, or alias, is provided. For instance, int is the short name for System.Int32 and double is the short form of System.Double.
Now, read this article for the difference: Primitive Types & Value Types
System.String
maps to "string
", which is a primitive type in the CLI. But in the reality, value types are the ones which go in the stack and not in the heap space.
So, the key is Value types vs Primitive types. By Microsoft's definition of primitive, it is a primitive type, but in a more general sense, its not.