for ( fileVector_t::iterator i = filev.begin(); i != filev.end(); ++i ){
cout << "Extension: " << i->extension_ << "\n " << "Size: " << i->size_ << endl;
unsigned filenum=1;
fileVector_t::iterator iter = i;
if( i == filev.end() )
break;
++iter;
if (iter->extension_ == i->extension_)
cout << "same" << endl;
I'm getting an iterator not dereferencable error, because of the ++iter line I assume. Everything runs smoothly if I don't increment the iterator by taking that line out. I don't understand why this won't work, I test to see if it's equal to end(); before I increment so it will never be past the end of the vector.
that makes so much sense. That's what I was trying to say but for the life of me I couldn't express it in my code, I tried soo many different things haha thank you.