edited by
237 views
–1 votes
–1 votes
Consider the following program:-

int a=5;

printf(&a);//print address of a

int b=malloc();

printf(&b); //print address of b

Will it print logical address in both cases?If yes,then does it mean that variables are created on secondary memory and then copied to man memory when required?I was under impression that this memory allocation happens in main meory.Please clarify.
edited by

Please log in or register to answer this question.

Related questions

4 votes
4 votes
5 answers
3