title: Printing pointer's address in C
body: <p>I'm reproducing printf from scrap and I need to store pointers address into a string then print it, so first I cast void* into an unsigned int then itoa it to hexadecimal but the last three char are wrong.</p>
  
  <pre><code>int     main(void)
  {
      char    str[] = "printf from scrap!";
  
      my_printf("MY_PRINTF:'%p'", (void*)str);
      printf("\n   PRINTF:'%p'\n\n", (void*)str);
  
      return (0);
  }
  
  int     conv_p(va_list args)
  {
      void    *ptr;
      unsigned int        ptrint;
  
      ptr = va_arg(args, void*);
      ptrint = (unsigned int)&amp;ptr;
      my_putstr("0x7fff");
      my_putstr(my_itoa_base_uint(ptrint, 16));
  
      return (1);
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>MY_PRINTF:'0x7fff505247b0'
     PRINTF:'0x7fff50524a20'
  </code></pre>
  
  <p>As you can see the last three char are wrong, is there any documentation about that?</p>