Sorting of vector containing structure
<p>I was trying to sort a vector of struct.The following is my code.I am not able to sort it properly...Can anyone help me..?I need to sort according to the mmNo.Sorry ...i missed some part of the code...</p>

<pre><code>typedef struct MMInfo
{
  std :: string strMmNo;
  std :: string strMmName;
  std :: string strMmsPlace;
  std :: string strMmAdd;
  std :: string strMmPh;

  MMInfo(const std::string&amp; mmNo,
         const std::string&amp; mmName,
         const std::string&amp; mmPlace,
         const std::string&amp; mmAdd,
         const std::string&amp; mmPh) : stringValue(mmNo,),stringValue(mmName),
                                    stringValue(mmPlace),stringValue(mmAdd),
                                    stringValue(mmPh) {}

  bool operator &lt; (const MMInfo&amp; str) const
  {
    return (mmNo &lt; str.mmNo);
  }

} MMInfo;

std::vector &lt; MMInfo &gt; mmlist;
MMInfo mmInfo = {"", "", "", "", ""};

mmInfo.strMmNo = "3452132";   //actually , i have used a loop to get it from the user
mmInfo.strMmName="Peter";
mmInfo.strMmPlace="TCR";
mmInfo.strMmAdd="Street 453";
mmInfo.strMmPh="8587556587";

mmlist.push_back(mmInfo);

sort(mmlist.begin(),mmlist.end());
for (int i=0; i&lt;mmlist.size(); i++)
{
  cout &lt;&lt; " first row :" &lt;&lt; mmlist[i].strMmNo &lt;&lt; " " &lt;&lt; mmlist[i].strMmName 
       &lt;&lt;" " &lt;&lt;mmlist[i].strMmsPlace  &lt;&lt; " " &lt;&lt; mmlist[i].strMmsAdd ;
}
</code></pre>
