title: Single, double quotes and sizeof('a') in C/C++
body: <p>I was looking at the question <a href="https://stackoverflow.com/questions/3683602/single-quotes-vs-double-quotes-in-c">Single quotes vs. double quotes in C or C++</a>. I couldn't completely understand the explanation given so I wrote a program:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
    char ch = 'a';
    printf("sizeof(ch) :%d\n", sizeof(ch));
    printf("sizeof(\'a\') :%d\n", sizeof('a'));
    printf("sizeof(\"a\") :%d\n", sizeof("a"));
    printf("sizeof(char) :%d\n", sizeof(char));
    printf("sizeof(int) :%d\n", sizeof(int));
    return 0;
  }
  </code></pre>
  
  <p>I compiled them using both gcc and g++ and these are my outputs:</p>
  
  <h3>gcc:</h3>
  
  <pre><code>sizeof(ch)   : 1  
  sizeof('a')  : 4  
  sizeof("a")  : 2  
  sizeof(char) : 1  
  sizeof(int)  : 4  
  </code></pre>
  
  <h3>g++:</h3>
  
  <pre><code>sizeof(ch)   : 1  
  sizeof('a')  : 1  
  sizeof("a")  : 2  
  sizeof(char) : 1  
  sizeof(int)  : 4  
  </code></pre>
  
  <p>The g++ output makes sense to me and I don't have any doubt regarding that. In gcc, what is the need to have <code>sizeof('a')</code> to be different from <code>sizeof(char)</code>? Is there some actual reason behind it or is it just historical?</p>
  
  <p>Also in C if <code>char</code> and <code>'a'</code> have different size, does that mean that when we write 
  <code>char ch = 'a';</code>, we are doing implicit type-conversion?</p>