title: Do pointers refer to physical or to virtual memories?
body: <p>I recently learned that computer programs do not actually make use of the physical memory's address. Rather, I understand that the physical memories are 'hidden' by the operating system to the application. </p>
  
  <p>Here comes my question:
  Do pointers return the address of the physical memory or the virtual memory?</p>
  
  <p>If I execute the code below, I get a hexadecimal form of an address. Is it just a number that was randomly assigned by the operating system? And also, I found out that the addresses of the elements in an array are assigned successively. Does this mean that an array is actually in a 'line' form in the RAM, or is it possible for them to be assigned in sparse regions and the OS merely fakes the programmer?</p>
  
  <pre><code>int num = 3;
  int arr[3];
  
  printf("address of num: 0x%0x \n", &amp;num);
  printf("&amp;arr[0]: 0x%0x \n", &amp;arr[0]);
  printf("&amp;arr[1]: 0x%0x \n", &amp;arr[1]);
  printf("&amp;arr[2]: 0x%0x \n", &amp;arr[2]);
  </code></pre>