L
leshanster
I am quite new to C# (really .NET alltogether ), and I have a
question about referencing objects.
Say I have a class called node, and I have an ArrayList of nodes called
nodeList. I also have a function called getPos(string name) that given
the name of the node, it will return the position of the node in the
array.
now if I say:
node temp;
int i;
i = getPos(name);
temp = (node) nodeList;
will temp actually be a pointer to the node in the ArrayList, or will
temp have a copy of that particular node in the list? I am trying to
figure out if I manipulate temp, will I need to update the node in the
ArrayList, or is it already changed?
Thanks and sorry if this is an easy question
question about referencing objects.
Say I have a class called node, and I have an ArrayList of nodes called
nodeList. I also have a function called getPos(string name) that given
the name of the node, it will return the position of the node in the
array.
now if I say:
node temp;
int i;
i = getPos(name);
temp = (node) nodeList;
will temp actually be a pointer to the node in the ArrayList, or will
temp have a copy of that particular node in the list? I am trying to
figure out if I manipulate temp, will I need to update the node in the
ArrayList, or is it already changed?
Thanks and sorry if this is an easy question