Possible Duplicates:
How is malloc() implemented internally?
How do free and malloc work in C?
whenever we write the program using malloc , calloc and realloc where does the varies go and sit, i.e in which part of the memory do they go and reside. also whether the variables (in all cases) are allotted a contiguous space or the variables go and sit wherever the space is available