C # value-type data is stored directly in the memory allocated to it, while C # reference type only contains pointers pointing to the location of the stored data.
Basic data type (except string type): including integer, floating point, decimal, and Boolean.
Integer types include sbyte, byte, char, short, ushort, int, uint, long, And ulong;
Float Type: float and double; decimal type: decimal; boolean type: bool type.
Structure Type: struct type.
Enumeration type: enum type.
There are five types of reference: class, interface, delegate, object, string
When the reference type is used as a parameter:
1. When modifying the variable itself, the result is similar to passing the value, that is, the value of the variable before the passing is not changed.
2. When modifying the attributes or fields of a variable, it is passed by reference, which will affect the value of the variable before transmission.
3. When the ref parameter is used, it is the actual reference transfer. Whether the variable itself is modified or the attribute or field of the variable is modified, the value of the variable before transmission will be affected.
Value Transfer: transfers the object's value copy. (That is, the parameter object in the function is a copy of the object in the stack of the object passed during the call .)
Reference transfer: transmits the address of the object in the stack. (That is, the parameter object in the function and the object passed during the call are all objects in the same stack .)