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

后端 未结 4 1894
既然无缘
既然无缘 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:32

    At the time of c program execution another processes are running.While executing a code again you will allocate new address previously allocated address will be allocate for another process.

提交回复
热议问题