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 = "we" ( or "you" ) ,word_2 = "WORK", word_3 = "today" the match with studsubj is perfect. The problem is lines starting with "THEY". 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 = " "; } // 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 = " "; } // 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 =" "; } 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("we"," WORK","today"

, subject("option 3"

)); /* 2 */ studsubj.insert(pair(student("you"," ;WORK","today"

, subject("option 4"

)); /* 3 */ studsubj.insert(pair(student("THEY",&quo t;do","work"

, subject("option 1"

)); /* 4 */ studsubj.insert(pair(student("THEY",&quo t;read","books"

, subject("option 1"

)); /* 5 */ studsubj.insert(pair(student("THEY",&quo t;work","today"

, subject("option 1"

)); string word_1="we",word_2 = "WORK",word_3 ="today"; // 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