Top Memory Allocation most frequently asked C++ Questions and Answers
Memory Allocation interview Questions and Answers List
- How new/delete differs from malloc()/free?
- How the delete operator differs from the deleteoperator?
- How a new operator differs from the operator new?
- Explain the term memory alignment.
- Explain the concept of dynamic allocation of memory.
- In the expression, char *c = (char *)malloc(20); followed by free(r); explain the role of mallocQ operator in allocating the number of bytes?
- Is it possible to use the free operator with the new allocated pointers and the delete operatorQ with the
malloc allocated pointers?
- Can a new be used in place of old mallocQ? If yes, why?
- Is it possible to use a new for the reallocation of pointers ?
- Is there any need for checking of NULL after executing p = new Animal ()?
- Can a NULL be checked before deleting the p variable froi the expression, Delete p; and not if (p != NULL) ?
- Enlist the processes involved in deleting a variable.
- On throwing an exception by the Animal constructor in p = new AnimalQ, can memory leak occur?
- What is the use of  in the delete statement of the following expression:
- What would happen on forgetting , while deallocating an array through new?
- Can  be dropped on deletion of some built-in type array (char, int etc)?
- Write about the retrieval of n number of objects during the process of deletep?
- Is it possible for a member function to use delete this?
- Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification.
- What is the role of copy constructor in copying of thrown objects?
- How can an improvement in the quality of software be done by try/catch/throw?
- Explain the process of catching a variable.