title: C++: How to make a simple dictionary?
body: <p>I'm trying to make a dictionary with 2-character words but not so much success
  Here's my code:</p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;map&gt;
  using namespace std;
  
  int main(int argc, char *argv[]){
      map&lt;char*,int&gt; m;
      //input 5 two-lengthed words 
      for (int i=0;i&lt;5;i++){
          char s[3];
          cin&gt;&gt;s;
          s[2] = '\0';
          m[s]=1; //add a key
      }
      //checking if a word exists.
  
      cout&lt;&lt;"Word you want to check whether it exists:"&lt;&lt;endl;
      char chck[3];
      cin&gt;&gt;chck;
      chck[2]='\0';
      //I heard this is how you check whether a key exists:
      bool exists = m.find(chck)==m.end(); 
      cout&lt;&lt;((exists)?"Yes!":"No.")&lt;&lt;endl;
      system("pause"); //Yea, system, I know.
      return 0;
  }
  </code></pre>
  
  <p>Whenever I enter the words, and then when I want to check whether a word is in a dictionary, I always get printed "No."?<br>
  I come from <strong>Java</strong> so I got used to references, not pointers, so that's where I'm probably wrong. I want to learn how to properly use the maps so can you please what am I supposed to do here? <br><br>
  Thanks</p>