answersLogoWhite

0


Best Answer

Are you talking about freeing dynamically allocated memory in C/C++? free() is a function that you use to release dynamically (i.e. at run-time) created memory in C, using malloc() or alloc() or such other functions. In the same way, delete() is a function that is used in C++ to release memory created at run-time using the function new(). (Note that you can still use malloc and other C functions in your C++ code, but it is not considered a good programming habit. Moreover, new() is easier to use and more flexible, once you get the hang of it.

If this is not what you had in mind, then I do not know if this will be of any help to you.

addition:

-new is constructor of which delete is destructor so use in pairs always.. similarly use malloc with free..

extra note:

- no type cast required for new , whereas malloc, free may require it.

- new returns exception whereas malloc returns NULL when memory issue.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between delete and free?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Difference between format and delete?

What is the difference between delete and format?


What is the difference between delete and delete sheet command?

delete command would delete selected word,line, paragraph or even sheet. Whereas delete sheet command would delete the whole sheet


What are the difference between interest free and conventional banking system?

difference between interest and interest free financing


What is the difference between free will and destiny?

You can change free will


What is difference between delete file in DOS and delete file in Windows?

i don't know the difference but what i know is ... deleted file from MS-DOS is never go to the recycle bin. Thanks !


Difference between the delete key an the back space?

The backspace key deletes to the left of the cursor, and the delete key deletes to the right of the cursor.


The difference between free enterprise and laissez faire?

There is no difference.


What is the difference between Liberty Party and the Free Soil Movement?

the difference is..................................................... i dont know


What is the difference between free blubster and upgrade?

one is pro and one is free


Difference between wrinkle free and wrinkle resistance?

Wrinkle free and wrinkle resistance sounds same but there is some difference .


Difference between alcohal-free perfume?

there is no alcohal in it


What is the difference between the free and the full version of terraria?

There is no free version. You have to buy it to play it.