Why address of a variable change after each execution in C?

后端 未结 4 1891
既然无缘
既然无缘 2021-01-19 01:03
int i=10;
printf(\"Address of i = %u\",&i);

Output:
Address if i = 3220204848

Output on re-execution:
Address of i = 3216532594

I get a new a

4条回答
  •  耶瑟儿~
    2021-01-19 01:41

    It signifies that your program is being loaded a different (virtual) address each time you run it. This is a feature called Address Space Layout Randomization (ASLR) and is a feature of most modern operating systems.

提交回复
热议问题