title: Why does C++ always display a Hexadecimal memory address and not just an integer?
body: <p>I wanted to know why printing the address of a variable in c gives the output as something like 823759733
  while, doing the same in c++ shows 0x7ff6474009c??
  Is this the work of 'cout', that formats the address as a hex? or is the variable memory address cloaked to show some arbitrary address to encapsulate it??
  I know that everything is going on inside virtual memory in C++, is this the same for C?</p>
  <p>example -</p>
  <pre><code>int a=10;
  int* ptr=&amp;a;
  printf(&quot;%d&quot;, ptr);
  </code></pre>
  <p>it should print an integer.</p>
  <p>the same code written in c++
  and</p>
  <pre><code>cout&lt;&lt;ptr
  </code></pre>
  <p>it shows a hex(I want to know why?)</p>