Code:
/* (it is odd to me that he is using ElementCount and not ElementCount-1 as ElementCount sounds like it would be one after the last element of the array) */
InitialValue = Item[ ElementCount ];// remember the last item in the array
Item[ ElementCount ] = TestValue;// set the last item to TestValue
i=0;// start the index at the beginning of the array
while ( Item[ i ] != TestValue)// determine if this item of the array is not equal to TestValue
{// if it is not equal we enter the loop, if it is equal the loop terminates
i++;// increment the index
}
Item[ ElementCount ] = InitialValue;// reset the last element to what it was before we changed it
Is this the code in its entirety? To be quite honest it doesn't make complete sense; I mean I don't understand the point to the snippet. It is not determining anything nor changing anything. What did the author say he was demonstrating here?