title: How to print 64-bit integer in GCC 4.4.1?
body: <p>I am using <a href="http://www.codeblocks.org/" rel="noreferrer">Code::Blocks</a> with GCC 4.4.1 and I seem to be unable to print 64-bit signed integers from my C-code.</p>
  
  <p>This code:</p>
  
  <pre><code>long long longint;
  
  longint = 0x1BCDEFABCDEFCDEF; /* 2003520930423229935 */
  printf("Sizeof: %d-bit\n", sizeof(longint) * 8);     /* Correct */
  printf("%llx\n", longint);                           /* Incorrect */
  printf("%x%x\n", *(((int*)(&amp;longint))+1), longint);  /* Correct */
  printf("%lld\n", longint);                           /* Incorrect */ 
  </code></pre>
  
  <p>Produces output:</p>
  
  <pre><code>Sizeof: 64-bit
  cdefcdef
  1bcdefabcdefcdef
  -839922193
  </code></pre>
  
  <p>64-bit arithmetic seems to work correctly:</p>
  
  <pre><code>longint -= 0x1000000000000000;
  printf("%x%x\n", *(((int*)(&amp;longint))+1), longint);
  </code></pre>
  
  <p>Gives:</p>
  
  <pre><code>bcdefabcdefcdef
  </code></pre>
  
  <p>Am I missing something?</p>