i have a statement in my program which does a comparision of elements of a two vectors
if(!*(it2+3).compare(*(lines_in_file.begin())))
the compiler error i am getting is:
test_file.cpp:140: error: 'class __gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >' has no member named 'compare'
it2‘s type is :
vector<std::string>::iterator it2=rec_vec.begin();
lines_in_file type is :
vector<std::string> lines_in_file=split(argv[2],',');
split function declaration is :
std::vector<std::string> split(const std::string &s, char delim)
I am confused a bit.already spent a lot of time thinking.
could any one please help?
The problem is that the operator “.” have greater precedence that “*” so this should solve the problem.