<contactmayankjain@gmail.com> wrote in message
news:1187626911.559829.298860@i38g2000prf.googlegroups.com...
> Hi,
>
> Its said that one should avoid dynamic allocation of memory, as it de-
> fragment the memory into small chunks and allocation of memory is a
> costly process in terms of efficiency. So what is the best solution to
> handle to situation in which we need to allocate memory at run time.
Dynamic allocation is the ONLY solution to allocating memory at run time
(unless you use a language that provides garbage collection). If you have
problems with fragmentation then the only thing you can do is smarter
dynamic allocation, which requires knowledge of the allocation requirements
of your application.