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.
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
Thank you! Your comments have been successfully added. However, they need to be checked by the moderator before being published.
Comments
Dear customer, Please contact our support department via info@assignmentexpert.com or use live chat on this website.
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.
how can you delete your account on here?
Do you pay for asking a question?
Leave a comment