Hey guys,
So I am just trying to get a sense of things with C#, here are my two questions:
Question 1
I have variables:
PlayerClass playerOne;
PlayerClass playerTwo;
PlayerClass currentPlayer;
If I do this:
currentPlayer = playerOne;
am I getting a copy of the playerOne class? or a pointer to its location in memory?
Question 2:
If I pass currentPlayer as a parameter to another class:
PowerUpManager.Enable(currentPlayer);
am I getting a copy? or a pointer. I know this is a silly question I’ve just seen a few strange posts about c#. Thanks in advance for clearing this up.
in first case you get a pointer. for second case http://msdn.microsoft.com/en-us/library/s6938f28(v=vs.80).aspx will help to figure out whats happening