title: Is there any way to output the actual array in c++
body: <p>So, I'm beginning C++, with a semi-adequate background of python. In python, you make a list/array like this:</p>
  
  <pre><code>x = [1, 2, 3, 4, 5, 6, 7, 8, 9]
  </code></pre>
  
  <p>Then, to print the list, with the square brackets included, all you do is:</p>
  
  <pre><code>print x
  </code></pre>
  
  <p>That would display this:</p>
  
  <pre><code>[1, 2, 3, 4, 5, 6, 7, 8, 9]
  </code></pre>
  
  <p>How would I do the exact same thing in c++, print the brackets and the elements, in an elegant/clean fashion? NOTE I don't want just the elements of the array, I want the whole array, like this:</p>
  
  <pre><code>{1, 2, 3, 4, 5, 6, 7, 8, 9}
  </code></pre>
  
  <p>When I use this code to try to print the array, this happens:</p>
  
  <p>input:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  
  int main()
  {
      int anArray[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
      cout &lt;&lt; anArray &lt;&lt; endl;
  
  }
  </code></pre>
  
  <p>The output is where in memory the array is stored in (I think this is so, correct me if I'm wrong):</p>
  
  <pre><code>0x28fedc
  </code></pre>
  
  <p>As a sidenote, I don't know how to create an array with many different data types, such as integers, strings, and so on, so if someone can enlighten me, that'd be great!
  Thanks for answering my painstakingly obvious/noobish questions!</p>