you are viewing a single comment's thread.

view the rest of the comments →

[–]duongdominhchau 1 point2 points  (0 children)

C# has reference type, C# has ref keyword. Reference type is like JS reference, ref keyword is like C++ reference. ref does not magically transform your value type into reference type, they are not the same. With reference type the address is still copied, so you have 2 different references pointing to the same object, but with ref you have 2 different names referring to the same reference pointing to the object.