title: Why does auto in `auto s = "abc"` yield char pointer instead of char array?
body: <p>This program</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main() {
      auto s = "Hello, world!\n";
      decltype("Hello, world!\n") t = "Hello, world!\n";
      std::cout &lt;&lt; sizeof s &lt;&lt; ", ";
      std::cout &lt;&lt; sizeof t &lt;&lt; ", ";
      std::cout &lt;&lt; sizeof "Hello, world!\n" &lt;&lt; '\n';
      return 0;
  }
  </code></pre>
  
  <p>prints</p>
  
  <pre><code>4, 15, 15
  </code></pre>
  
  <p>This suggests that the type of <code>s</code> is <code>char *</code>. This feels wierd considering that the type of the string literal and <code>t</code> is <code>char [15]</code>.</p>
  
  <p>Why doesn't this program print <code>15, 15, 15</code> instead?</p>
  
  <p>Why does <code>auto</code> declare a pointer type instead of an array type when assigned to a string literal?</p>