Maybe someone could help me understand what is wrong here. Below is a simple multimap studsubj, and I compare word_1,word_2 word_3 with it. I give these words the values exactly like in studsubj, then compare. For example, if word_1 = &quot;we&quot; ( or &quot;you&quot; ) ,word_2 = &quot;WORK&quot;, word_3 = &quot;today&quot; the match with studsubj is perfect. The problem is lines starting with &quot;THEY&quot;. To be more exact, the first line is ok, but comparing with any of the other two only has match with word_1, but not word_2 and word_3. I use iMac, OSX 10.6.8, programming tool - Xcode. Thank you very much. [code=C++] #include #include #include using namespace std; class student { private: string element1; string element2; string element3; public: student( ) { element1 = element2 = element3 = &quot; &quot;; } // default constructor student(string a,string b,string c):element1(a),element2(b),element3(c) {} // all elements filled student(string a):element1(a) { element2 = element3 = &quot; &quot;; } // to compare element1 string e_1( ) { return element1; } string e_2( ) { return element2; } string e_3( ) { return element3; } }; bool operator < (student a,student b) { return a.e_1() < b.e_1(); } class subject { private: string option; public: subject( ) { option =&quot; &quot;; } subject(string a)ption(a) {} string str( ) { return option;} }; typedef multimap mapsub; int main( ) { typedef multimap mapsub; mapsub studsubj; mapsub::const_iterator ptr; /* 1 */ studsubj.insert(pair(student(&quot;we&quot;,&quot; WORK&quot;,&quot;today&quot, subject(&quot;option 3&quot)); /* 2 */ studsubj.insert(pair(student(&quot;you&quot;,&quot ;WORK&quot;,&quot;today&quot, subject(&quot;option 4&quot)); /* 3 */ studsubj.insert(pair(student(&quot;THEY&quot;,&quo t;do&quot;,&quot;work&quot, subject(&quot;option 1&quot)); /* 4 */ studsubj.insert(pair(student(&quot;THEY&quot;,&quo t;read&quot;,&quot;books&quot, subject(&quot;option 1&quot)); /* 5 */ studsubj.insert(pair(student(&quot;THEY&quot;,&quo t;work&quot;,&quot;today&quot, subject(&quot;option 1&quot)); string word_1=&quot;we&quot;,word_2 = &quot;WORK&quot;,word_3 =&quot;today&quot;; // input words to сомраre with words from multimap studsubj student st(word_1); ptr = studsubj.find(st); if(ptr != studsubj.end()) { student st= ptr->first; cout