The ones who are crazy enough to think they can change the world are the ones who do.- Steve Jobs
Let us consider that you are starting your own company where you provide a different operating systems for your clients. You have 6 individual teams in your startup company where every team has their own individual part to program in a microprocessor. Unfortunately microprocessors are inbuilt with very small amount of memory. Now its your responsibility to allocate or divide certain amount of memory in the microprocessor to every individual teams. Here is the dynamic memory allocation in c programming to help you out there.
When a programmer knows the exact size of the data, array is good choice. When a programmer have no idea about the size of the data, then you are left with one way is by using Dynamic Memory Allocation.
In-Built Functions | Purpose |
---|---|
malloc() | Allocates memory where allocated memories are represented by some garbage value. |
calloc(). | Allocates memory where allocated memories are represented by zero. |
free() | To free the already allocated memory. |
realloc() | To reallocate the memory dynamically as per demand. |
coreleft() | To measure the unused memory. |
We may make mistakes(spelling, program bug, typing mistake and etc.), So we have this container to collect mistakes. We highly respect your findings.
© Copyright 2019