title: Printf() printing of arguments and pointers in C
body: <p>Okay so basically i am trying to understand what is happening here with printf and pointers in various forms </p>
  
  <p>this is the code </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct mine{
     unsigned int  memory;
     struct mine * next;
  }mine;
  
  
  int main(int argc, char *argv[]){
  
     mine * y;
  
     y = (struct mine *)malloc(sizeof(struct mine));
     y-&gt;memory = 0xBEEFDEAD;
  
     printf("%x\n",*y);
     printf("%x\n",y[0]);
     printf("%x\n",y-&gt;memory);
     printf("%x %x %x\n",y-&gt;memory, *y,y[0]);
  
     return 0;
  }
  </code></pre>
  
  <p>and here is the output</p>
  
  <pre><code>beefdead
  beefdead
  beefdead
  beefdead beefdead 7c00c0
  </code></pre>
  
  <p>as you can see the same pointers being printed give a different result with printf when they are separated individually and when they are grouped together </p>
  
  <p>is this a problem with the way i am printing the pointers, or is this a problem with printf </p>
  
  <p>also does *y = y[0] = y->memory </p>
  
  <p>from the output i am not sure about the answer to this question </p>