if i write
while(1)
{
i=(int *)malloc(sizeof(int));
}
here each location will be assigned to i after 16 addresses. But why…??? o_O
if i write
while(1)
{
i=(int *)malloc(sizeof(int));
}
here each location will be assigned to i after 16 addresses. But why…??? o_O
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
As i think
each time stmt in loop executes malloc allocates memory ..which can be any memory address, its not necessary it will be continuous.
it will give continuous memory if we define no of elements in its arguments like
malloc(sizeof(int)*4);