title: Can I output a Windows handle using %p specifier?
body: <p>This is a kind of follow-up to <a href="https://stackoverflow.com/q/11688162/57428">this question</a>. Windows SDK features <code>HANDLE</code> datatype that is defined in <code>WinNT.h</code> as follows:</p>
  
  <pre><code>typedef void *HANDLE;
  </code></pre>
  
  <p>This datatype is used to represent handles. Technically a handle is not a pointer - it's magic value that can only be used with Win32 functions. Yet it is declared to be represented with a datatype that is a <code>void*</code> typedef.</p>
  
  <p>If I want to output the handle hex value with the following code:</p>
  
  <pre><code>HANDLE handle = ...;
  printf("%p", handle);
  </code></pre>
  
  <p>will it be legal?</p>