title: Why does ostream prints `1` for a string defined as `volatile char[]`?
body: <p>Consider this (artificial) example:</p>
  
  <pre><code>#include &lt;cstdio&gt;
  #include &lt;iostream&gt;
  
  int main() {
    volatile char test[] = "abc";
    std::printf("%s\n", test);
    std::cout &lt;&lt; test &lt;&lt; "\n";
  }
  </code></pre>
  
  <p>Compiling it with GCC and running gives the following output:</p>
  
  <pre><code>$ g++ test.cc 
  $ ./a.out 
  abc
  1
  </code></pre>
  
  <p>As you can see <code>printf</code> prints the string correctly while <code>cout</code> prints <code>1</code>. Why does writing to <code>cout</code> produces <code>1</code> in this case?</p>