Good day,
Generally speaking, for C programming, what can I do, if the application which I am writing requires the heap to expand and contract dynamically?

Recommended Answers

All 3 Replies

Er, mostly the C runtime library takes care of it for you?

Do you have a specific "for example..." to tell us about where this standard behaviour is a problem?

amm...no...no example...
just wanna find out how to do it

the way i thought about it, i could probably use a link list or dynamically allocate the storage on the fly using caloc/malloc...

u think this would work?

Ah, you mean other expanding data structures like lists, queues, trees etc.
Sure, use malloc and free

When you say "the heap", you're referring to the pool of memory managed by the C runtime library functions malloc, calloc, realloc and free.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.