1.

Which of the following function can be used for dynamic memory allocation of objects?(a) malloc()(b) calloc()(c) create()(d) both malloc() and calloc()This question was posed to me during an interview.Origin of the question is Overloading Member Functions topic in portion Member Functions & its Types of Object Oriented Programming

Answer»

Right OPTION is (d) both malloc() and calloc()

The EXPLANATION: The malloc() function can be used to allocate DYNAMIC memory for objects. Function calloc() can also be USE. These functions differ in the way they allocate memory for objects.



Discussion

No Comment Found

Related InterviewSolutions