The function ____ obtains block of memory dynamically.
Answer: C
Correct answer: Both a & b
malloc and calloc both obtain blocks of memory dynamically from the heap. They differ in how the size is expressed and in whether the block is zeroed, not in where the storage comes from.
malloc takes a single total and leaves the contents arbitrary; calloc takes a count and an element size and clears the block. free is the counterpart that returns storage rather than obtaining it, and realloc resizes a block already held.
Please log in or register to report this question.