The main memory is divided into four segments they are Heap segment Data Segment Code segment and Stack segment
All dynamically allocated memory is stored in Heap segment which grows both upwards and downwards in memory. You allocate memory dynamically in C using malloc() calloc() and realloc() functions. So Heap data segment and Heap data structure are completely differen concepts and are not related. Heap data structure is usually a binary tree wherein the child nodes are always smaller than the parent nodes. Whereas Heap data segment is the name given to the data segment in memory. They are completely different. Hope This Helps..... On Thursday, September 1, 2011, teja bala wrote: > > > whenever u try to declare variables that are allocated dynamically using >> let us say new the memory is allocated for that variable 'll be from heap >> and if u want to deallocate it u've to use constructor. >> > ->recursive allocation,local varibles from stack > ->global and static variables are allocated from data segment > ->register variables are allocated from registers > > hope this 'll help u. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to > [email protected]<javascript:_e({}, 'cvml', > '[email protected]');> > . > To unsubscribe from this group, send email to > [email protected] <javascript:_e({}, 'cvml', > 'algogeeks%[email protected]');>. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Regards Rajeev N B <http://www.opensourcemania.co.cc> "*Winners Don't do Different things , they do things Differently"* -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
