title: Why can't I use cout to print an array of string values in C++?
body: <p>This is a code snippet from a pretty simple program I am writing. I am fairly new to C++, but have background in Java, so I may have preconceptions as to how printing values should work.  My problem is when I do this line:</p>
  
  <pre><code>cout &lt;&lt; "Please enter the weight for edge " &lt;&lt; verticies[i] &lt;&lt; endl;
  </code></pre>
  
  <p>I get an error message saying that the operands do not match the designated operator for &lt;&lt;.  Basically it is saying I can't do  cout &lt;&lt; verticies[i].</p>
  
  <p>Why does this happen?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  using namespace std;
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      string verticies[6] = { "AB", "AC", "AD", "BC", "BD", "CD" };
      int edges[6];
  
      for (int i = 0; i &lt; 6; i++)
      {
          cout &lt;&lt; "Please enter the weight for edge " &lt;&lt; verticies[i] &lt;&lt; endl;
      }
  
      system("PAUSE");
  
      return 0;
  }
  </code></pre>