title: What happens when I assign a negative value to an unsigned int?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/50605/signed-to-unsigned-conversion-in-c-is-it-always-safe">signed to unsigned conversion in C - is it always safe?</a>  </p>
  </blockquote>
  
  
  
  <p>Let's say I declare a variable of type unsigned int : <code>unsigned int x = -1;</code></p>
  
  <p>Now -1 in two's complement (assuming 32 bit machine) is 0xFFFFFFFF.
  Now when I assigned this value to x, did the value 0x7FFFFFFF get assigned to x?</p>
  
  <p>If it were so, then printf ("%d",x); would have printed the decimal equivalent of 0x7FFFFFFF, right? But, clearly this isn't happening, as the value that gets printed is -1. What am I missing here?</p>
  
  <p>Edit: I know that we can use the %u format specifier to print unsigned values.
  But that doesn't help answer the question above.</p>