Problem: std::sort() function use
i have a class MyStrVec which contains a vector of class MyString.
i want to use the std::sort function on that vector and wanna sort all vector members by the int count variable in MyString class. how will i do all this..
i have written 2 parameters but whats third parameter
Code:
class MyString
{
private:
string inputString;
int count;
public:
MyString(string& , int& );
};
class MyStrVec
{
private:
vector <MyString> myStrVec;
public:
MyStrVec(){};
void sort()
{
std::sort( myStrVec.begin(), myStrVec.end() );
};
};