Dereferencing and Equality?
Sooo I'm working on a problem that requires me to use iterators. What im trying to do is test for equality of items in two lists that is being traversed with 2 separate iterators. However I am getting an error when I run my code, saying list iterator not dereferencable. I am pretty sure my two things are list iterators. Trying to debug it, it goes to these few lines first...
Code:
if(*current != *sorted_index){
while(*current != *sorted_index){
current++;
}
}
So I was wondering if what I wrote is actually proper to do. Thank you!