Same memory space being allocated again & again while using malloc()
- by shadyabhi
In each loop iteration, variable j is declared again and again. Then why is its address remaining same?
Shouldn't it be given some random address each time?
Is this compiler dependent?
#include<stdio.h>
#include<malloc.h>
int main()
{
int i=3;
while (i--)
{
int j;
printf("%p\n", &j);
…