GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

How to make a function equivalent to malloc without using any other inbuilt function?

1 Answer

I don't think there is a way in C.  The only way I can think of is to make system calls using system().   But this solution is OS specific.  Different OSs may have different system calls to allocate memory on heap.   For example sbrk ( ) in UNIX and UNIX like operating systems.

answered Dec 18, 2015 by learner