I'm currently developing a Console App to manage students. I have the Classes and Methods all set up and they are accesible. However, When I'm editing the "add" method, I use a for loop to create a INTEGER that contains the Array Element that contains "".
I use
for (int i = 0; p.students[i] != ""; i++)
{
Console.WriteLine(i);
Console.ReadKey();
}
Its supposed to start at ZERO and if the Array Element of the value of i = "".... it adds 1 to i and starts again. However it seems to stop at 0. I know that the first 3 elements have content while the 4th is "".
Any idea what I'm doing wrong?
Thanks in advance, Bryan
List<Student>to obviate the issue - they never have empty elements.