title: How is it that main function is always loaded at the same address whereas variables have different address most of the time?
body: <p>I wrote this small program today and I was blown away by the results. Here is the program</p>
  
  <pre>
  <code>
  int main(int argc, char **argv)
  {
   int a;
   printf("\n\tMain is located at: %p and the variable a is located at address: %p",main,&a);
   return 0;
  }
  </code></pre>
  
  <p>on my machine the main function is always loaded at address "0x80483d4" and the address of the variable keeps on varying How does this happen? I read in operating systems that as a part of virtualization scheme the OS keeps relocating the address of instructions. So why is it that everytime I run this program that main is loaded at the same address?</p>
  
  <p>thanks in advance guys.</p>