title: Dumping address of a c-string to an ostream?
body: <p>I am learning pointers and I dont understand how pointers work with C-style strings. 
  Why are these two equivalent?</p>
  
  <pre class="lang-c prettyprint-override"><code>char a[] = "Gme";
  char* p = a; //Why am I allowed to assign "Gme" to a pointer (pointer is an address)
  
  cout &lt;&lt; p &lt;&lt; " " &lt;&lt; *(p+1); //Why does it print "gme" with "cout&lt;&lt;p" (I mean, I am printing an address)?
  </code></pre>
  
  <p>and</p>
  
  <pre class="lang-c prettyprint-override"><code>char a[] = "Gme";
  char* p = &amp;a[0];   // How is this the same as char* p = a;
  
  cout &lt;&lt; p &lt;&lt; " " &lt;&lt; *(p+1);
  </code></pre>
  
  <p>Overall, I do not understand how pointers work with strings. How are chars stored in memory? If we consider string as an array of chars,why can't I print the address of a char element? </p>
  
  <p>Thanks in advance :)</p>