title: c++ use cout in class method
body: <p>I'm getting <code>cin</code> <code>cout</code> and <code>endl</code> as undeclared errors despite using <code>#include &lt;iostream&gt;</code></p>
  
  <pre><code>#include "navigation.h"
  #include &lt;iostream&gt;
  Navigation::Navigation()
  {
      xPos=0;
      yPos=0;
  }
  void Navigation::Move()
  {
      //get direction
      int dir;
      cout &lt;&lt; "Select a direction: " &lt;&lt; endl;
      cout &lt;&lt; "1) North    3) South" &lt;&lt; endl;
      cout &lt;&lt; "2) East     4) West " &lt;&lt; endl;
      cin &gt;&gt; dir;
      //move
      switch(dir)
      {
      case 0://north
          yPos++;
          break;
      case 1://east
          xPos++;
          break;
      case 2://south
          yPos--;
          break;
      case 3://west
          xPos--;
          break;
      default:
          cout &lt;&lt; "Invalid entry" &lt;&lt; endl;
      }
  }
  
  void Navigation::Position(int &amp;x, int &amp;y)
  {
      x = xPos;
      y = yPos;
  }
  </code></pre>