Answer to Question #538 in C++ for anna-molly

Question #538
Can I use new/delete and malloc/free in one program?
1
Expert's answer
2010-08-04T11:15:22-0400
It is possible, but to free the memory that was allocated by operator new you have to use operator delete, and for the memory allocated by malloc – operator free. You should not mix them – it may lead to the crash of the program. The reason is that allocating the memory operator new leaves special marks for the allocated block which are then used for its release.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
27.01.14, 16:48

Dear customer, Please contact our support department via info@assignmentexpert.com or use live chat on this website.

Assignment Expert
16.01.14, 17:30

Asking questions is free and huge number of answers is published for free. If your question will require a lot of work and cannot be done for free, you will be informed.

Glory
14.01.14, 01:54

how can you delete your account on here?

Glory
14.01.14, 01:54

Do you pay for asking a question?

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS