title: C/C++ sizeof operator: Why does sizeof( 'a' ) return different values?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2172943/size-of-character-a-in-c-c">Size of character (&#39;a&#39;) in C/C++</a>  </p>
  </blockquote>
  
  
  
  <p>I am a beginner at C, and was confused by this.</p>
  
  <p><code>C:</code> I tried printing the sizeof( 'a' ) in C using the "%zu" modifier, and it prints a value 4.</p>
  
  <p><code>C++:</code> Printing sizeof( 'a' ) in C++ using cout, and printf(using the format above) both printed a value 1.</p>
  
  <p>I believe the correct value should be 1, since 'a' will be taken as a char. Why doesn't it return 4 in C? Are the sizeof operations of both different in both the languages? If so, what's the difference, and why does it return a different value?
  I used the gcc compilers in both cases.</p>