title: C how to print address as a decimal value (not hex) without compiler warnings
body: <p>I have an <code>int</code> pointer that points at the address of another <code>int</code>.</p>
  <p>When printing the pointer with the format specifier <code>%p</code> (as suggested by many answers on Stack Overflow), it's printed with a <strong>hexadecimal</strong> representation.</p>
  <p>How can I print a pointer's value with with a <strong>decimal</strong> representation?</p>
  <hr />
  <p><strong>Code Sample</strong></p>
  <p>I have figured out one can maybe use <code>%zu</code> from <a href="https://stackoverflow.com/a/15337836">this answer</a>.</p>
  <pre class="lang-c prettyprint-override"><code>int i = 1;
  int *p = &amp;i;
  printf(&quot;Printing p: %%p = %p, %%zu = %zu\n&quot;, p, p);
  </code></pre>
  <p>When I run that code using <a href="https://onlinegdb.com/EBienCIJnm" rel="nofollow noreferrer">https://onlinegdb.com/EBienCIJnm</a></p>
  <ul>
  <li>It actually prints the correct value in decimal</li>
  <li><em>But</em> it also outputs a compiler warning</li>
  </ul>
  <pre class="lang-none prettyprint-override"><code>warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 3 has type ‘int *’ [-Wformat=]                                                                 
  Printing p: %p = 0x7ffee623d8c4, %zu = 140732759529668
  </code></pre>
  <p>Is there a way to <code>printf</code> a pointer's value with a decimal representation, without compiler warnings?</p>