Working in c#. This is my current code
The variable "words" is an array that has been streamed from a file, the file is a series of lists. The two arrays named UID and RegNo are trying to take the different parts of the lists. UID works but RegNo causes an error because it overshoots the length of the array. Any ideas on how to fix this??
Code:
string[] UID = new string[studentlength];
string[] RegNo = new string[studentlength];
int j = 0;
int k = 1;
for (int i = 0; i < words.Length; i=i+5)
{
UID[j++] = words[i];
RegNo[k++] = words[i];
}
Comment