Q:

can not use the list iterator in c++

ok so i have errors in my code where i include an iterator.
here is the buggy part of my code:
for(list<char>::iterator it = eatUpRight.begin();it!= eatUpRight.end();it+=2)
{
    board[*it][*(it+1)]=3;
    _3eat2(*it,*(it+1),eatOptions,newCurrentEatingOption);
    board[*it][*(it+1)]=0;
}

don't worry about the board and _3eat2 and any other identifier because that is defentlly not the problem.
all you need to know is that board is a 2d array.   
board[*it][*(it+1)]

the (it) is supose to be the index of the 2d array,but it gives me errors instead.
and gives me other errors on everywhere else that i try to use the iterator.
so can you please tell me whats wrong with this code?

A:

it + 1 is only valid for RandomAccessIterators. list doesn't provide RandomAccessIterators, but BidirectionalIterators. See an overview of the iterator library here. Use std::advance, to abstract away the difference of those operations.

