No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
bool operator!= (CustomString &str1, CustomString &str2) { std::vector<string>:: iterator s2 = (str2.vec).begin(); for(std::vector<string>:: iterator s = (str1.vec).begin(); s != (str1.vec).end(); ++s) { if( *s2 == *s) { cout << *s2 << *s << endl; return false; } ++s2; } return true; } I don't know why, but this returns true … |
|
StringVec func(StringVec & str1, Stringvec & str2) { std::vector<string>::iterator s2 = str2->vec.begin(); for (std::vector<string>::iterator s = str1->vec.begin(); s != str1->vec.end(); ++s) { if(s2 == NULL) { cout << "str2 is smaller than str1" << endl; } ++s2; } } When a iterator goes out of bound, because the vector is … |