No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
4 Posted Topics
I have a vector personInfo that contains class objects of person details vector<person> personInfo; I am trying to use std::find to search for a existing name in the vector. I overloaded my == operator. person.h class person { public: std::string name; friend bool operator==(const person &lhs, const person &rhs); }; … | |
Re: from what I know, you need to provide some codes. | |
Ihave a vector that contains monthyear Jan2013 Jan2013 Jan2013 Jan2014 Jan2014 Jan2014 Jan2014 Feb2014 Feb2014 Basically what I want to do is to search through the vector, for every same record, group them together like e.g total count for Jan2013 = 3; total count for Jan2014 = 4; total count … | |
I have a vector which contains class objects of classObjects vector<classObjects> classObjectVector; I am trying to use std::find to search for a record in my vector, but I get an error message error Invalid operands to binary expression due to this line. if (std::find(classObjectVector.begin(), classObjectVector.end(), "aElement") != classObjectVector.end()) { //found … |
The End.