Memory Allocation

Why is it suggested not to use malloc() or calloc() in C++ for memory allocation?

Questions by masveera   answers by masveera

Showing Answers 1 - 6 of 6 Answers

ajrobb

  • Sep 22nd, 2010
 

There may be a clash between malloc() and new as they don't HAVE to use the same heap library routines. Also, for arrays of classe objects, new invokes the default constructor. For single class objects new allows you to choose a different constructor.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions