title: What is p pointing to in int x=259; char *p = (char*)&x;?
body: <p>I came across a wield code and I can't understand it:</p>
  
  <pre><code>     int x=259;
       char *p = (char*)&amp;x;
       printf("%d ", *p);
       printf("%d ", *(p + 1));
       printf("%d ", *(p + 2));
       printf("%d ", *(p + 3));
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>     3 1 0 0
  </code></pre>
  
  <p>I've try changing x to many different numbers, the results made me more confused</p>
  
  <pre><code>     X            Output
      127           127 0 0 0
      128          -128 0 0 0
    256*127         0 127 0 0
    256*128         0 -128 0 0
  </code></pre>
  
  <p>so on...</p>
  
  <p>Can someone explain what is p pointing to in</p>
  
  <pre><code>    char *p = (char*)&amp;x;
  </code></pre>
  
  <p>and what does it print out.
  Thank you.</p>