CList<int,int&> listint;
for(int i = 0 ; i<10 ;i++)
{
listint.AddTail(i);
}
POSITION pos,nextPos ;
pos = listint.GetHeadPosition();
while(pos)
{
int a = listint.GetAt(pos);
nextPos = pos ;
listint.GetNext(nextPos);
if(a%2==0)
{
listint.RemoveAt(pos);
}
pos = nextPos;
}
for(int i = 0 ; i<10 ;i++)
{
listint.AddTail(i);
}
POSITION pos,nextPos ;
pos = listint.GetHeadPosition();
while(pos)
{
int a = listint.GetAt(pos);
nextPos = pos ;
listint.GetNext(nextPos);
if(a%2==0)
{
listint.RemoveAt(pos);
}
pos = nextPos;
}