title: no operator "<<" matches these operands
body: <p>No idea what's going on. I looked at other posts that are similar to this issue but no solution helped so far. Here's the code with comments by the parts giving errors. At one point it says that != doesn't work and in the rest of the code it's saying that &lt;&lt; isn't working.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;algorithm&gt;
  #include &lt;vector&gt;
  #include &lt;ctime&gt;
  #include &lt;cstdlib&gt;
  #include &lt;cctype&gt;
  
  using namespace std;
  //Hangman
  
  int main()
  {
      //setup
      vector&lt;string&gt; words;
      words.push_back("GUITAR");
      words.push_back("VIRGINIA");
      words.push_back("LAPTOP");
      words.push_back("WIFEY");
      words.push_back("IPHONE");
  
      srand(static_cast&lt;unsigned int&gt;(time(0)));   //randomly select a word
      random_shuffle(words.begin(), words.end());
      const string THE_WORD = words[0];
      const int MAX_WRONG = 8;                    //initialize wrong guesses
      int wrong = 0;
      string soFar(THE_WORD.size(), '-');         //initalize the word so far with dashes
      string used = " ";                          //initalize letters used
  
  
      cout &lt;&lt; "Welcome to Hangman. Good luck!/n";
  
      //game loop
      //continues until a player guesses the word or gets too many wrong guesses
      while ((wrong &lt; MAX_WRONG) &amp;&amp; (soFar != THE_WORD)) //ERROR on the "!="
      {
          cout &lt;&lt; "\n\nYou have " &lt;&lt; (MAX_WRONG - wrong) &lt;&lt; " incorrect guesses left.\n";
          cout &lt;&lt; "\nYou've used the following letters:\n" &lt;&lt; used &lt;&lt; endl; //ERROR on "&lt;&lt;" between the string and used
          cout &lt;&lt; "\nSo far, the word is:\n" &lt;&lt; soFar &lt;&lt; endl; //ERROR on "&lt;&lt;" between the string and soFar
  
      //recieve the player's guess
          char guess;
          cout &lt;&lt; "\n\nEnter your guess: ";
          cin &gt;&gt; guess;
          guess = toupper(guess); //makes the guess uppercase since the secret word is uppercase
          while (used.find(guess) != string::npos)
          {
              cout &lt;&lt; "\nYou've already guessed " &lt;&lt; guess &lt;&lt; endl;
              cout &lt;&lt; "Enter your guess: ";
              cin &gt;&gt; guess;
              guess = toupper(guess);
          }
  
          used += guess;
  
          if (THE_WORD.find(guess) != string::npos)
          {
              cout &lt;&lt; "That's right! " &lt;&lt; guess &lt;&lt; " is in the word.\n";
  
              //updated soFar to include newly guessed letter
              for (int i=0; i &lt; THE_WORD.length(); ++i)
              {
                  if (THE_WORD[i] == guess)
                  {
                      soFar[i] = guess;
                  }
              }
          }
          else
          {
              cout &lt;&lt; "Sorry, " &lt;&lt; guess &lt;&lt; " isn't in the word.\n";
              ++wrong;
          }
      }
      //shut down
      if (wrong == MAX_WRONG)
      {
          cout &lt;&lt; "\nYou've been hanged!";
      }
      else
      {
          cout &lt;&lt; "\nYou guessed it!";
      }
  
      cout &lt;&lt; "\nThe word was " &lt;&lt; THE_WORD &lt;&lt; endl; //ERROR on "&lt;&lt;" between the string and THE_WORD
  
  
      int pause;
      cin &gt;&gt; pause; //this is here just so my compiler will stay open so I can see what's going on
      return 0;
  }
  </code></pre>