hey all, I'm trying to compare a node in an STL linked list to the next node in the list.
I have this line to compare:
where pos is a list<int>::iterator.Code:
if(*pos == *(pos + 1)) // compare to the next node
this seems like it should work to me, but my compiler (MetroWerks CodeWarrior IDE 4.1, MacOS9.1) gives me "Illegal operand" as an error.
I probably just don't understand pointer arithmetic like I thought: what can I do? Thanks!