J
John
I have an array with 5 items, when I retrieve the 5 items
I need to add (+1) one more item to the array to recreate it to
make a new array = 6. But as I am looping through the array
the program will crash because number 6 in the array does
not exist.
How can I loop through the array for the total items (5), but
still continue on for a loop of six? Because 6 is where I add
new informatiom into the array.
i.e
myClass[] mClass = new myClass[5];
int reccount = myClass.NumRecords;
for (int x = 0; x < reccount + 1; ++x)
{
mClass[x] = new myClass();
mClass[x].Name = chkRec[x].Name;
}
After it gets to 5 I need to add another record into the array
to make it six records. What is my best option to do this?
TIA
I need to add (+1) one more item to the array to recreate it to
make a new array = 6. But as I am looping through the array
the program will crash because number 6 in the array does
not exist.
How can I loop through the array for the total items (5), but
still continue on for a loop of six? Because 6 is where I add
new informatiom into the array.
i.e
myClass[] mClass = new myClass[5];
int reccount = myClass.NumRecords;
for (int x = 0; x < reccount + 1; ++x)
{
mClass[x] = new myClass();
mClass[x].Name = chkRec[x].Name;
}
After it gets to 5 I need to add another record into the array
to make it six records. What is my best option to do this?
TIA