Hi everybody
when I use a for loop or foreach on list<> that has a number of objects it always return the last object
for example:
where Session_ID is a property in a class session
and the list<session> is declared staticaly in Program class
what happen is Session_ID is always set to 4 (I have 4 objects)
please help
thanks in advance
when I use a for loop or foreach on list<> that has a number of objects it always return the last object
for example:
Code:
for (int i = 0 ; i < Program.session.length ; i++)
{
int id = Program.sessions[i].Session_ID
}
and the list<session> is declared staticaly in Program class
what happen is Session_ID is always set to 4 (I have 4 objects)
please help
thanks in advance
Comment