3
Answers

Pointing Problems

Kay

Kay

15y
2.5k
1
private void button1_Click(object sender, EventArgs e) { Card Card1 = new Card(); Card Card2 = new Card(); Card1.Value = 3; Card1.Suit = 3; Card2 = Card1; Card2.Suit = 2; } public class Card { public int Suit; public int Value; public Card() { Suit = 0; Value = 0; } } I step through the Button1 code and any changes on Card2 are updated across to Card1 like they were the same or if card2 were simply pointing to card1. What have I done wrong? THanks
Answers (3)