hi. can someone help me match, or mirror, these two pieces of code. they should both do the same thing in the same order. The array version should be pretty obvious. It adds a player to the player array, and increments. Im not sure how the playerArray, count, and the loop translate into the linked list version. if you take a shot at this, please continue the use of dot operator.
void CircleList::add(string s)
{
Player p;
p.name=s;
if(count==0) // no players at the table
{
// special case: adds a player to an empty table
playerArray[0]=p;
count=1; // adds the first player
whoWasLastToPlay=0; // whoWasLastToPlay at pos 0
}
else
{
for(int i=count-1; i>=whoWasLastToPlay+1; i--)
{
playerArray[i+1]=playerArray[i];
}
playerArray[whoWasLastToPlay+1]=p;
count++;
}
}