有人可以解释一下ref
吗?
var user = new User { Name = "MyName" };
ChangeNameToOtherName(user); // After method call user.name is "OtherName" < confusing
ChangeNameToOtherName(ref user); // After method call user.name is "OtherName"
var name = "MyName";
ChangeNameToOtherName(name); // After method call name is "MyName"
ChangeNameToOtherName(ref name); // After method call name is "OtherName"