It:
CheckPasswords(out notUsed, out notUsed);
notUsed ( , out), notUsed . . , notUsed , - , , out. :
user1 = "A";
- , user1 string - out string. , user1, , user1 - notUsed. notUsed "A". :
user2 = "B";
, - "B" notUsed. :
Console.WriteLine("user1: " + user1);
Console.WriteLine("user2: " + user2);
- , notUsed, user1 user2. , "B".
, :
class User {
public string Name { get; set; }
}
void NotMagic(User user1, User user2) {
user1.Name = "A";
user2.Name = "B";
Console.WriteLine("user1.Name = " + user1.Name);
Console.WriteLine("user2.Name = " + user2.Name);
}
void Main() {
User user = new User();
NotMagic(user, user);
}
, , B. , NotMagic, , . out ref, , .