1.

The number of arguments taken as input which allocating memory dynamically using malloc() is ___________(a) 0(b) 1(c) 2(d) 3This question was posed to me in an internship interview.The question is from DMA Functions, Memory Leak, Dangling Pointers topic in portion Dynamic Memory Allocation in C of C

Answer»

Correct choice is (B) 1

The best I can explain: An example of MEMORY allocated USING malloc():

(INT*)malloc(3*sizeof(int)

It is clear from the above example that malloc() takes only one argument as input, that is the number of bytes to be allocated.



Discussion

No Comment Found

Related InterviewSolutions