answersLogoWhite

0

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

14y ago

What else can I help you with?

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 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 !


What is the difference between free will and destiny?

You can change free will


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 free blubster and upgrade?

one is pro and one is free


Difference between alcohal-free perfume?

there is no alcohal in it


Is there a difference between a free and a paid forex course?

In a lot of cases there is not a difference between them. I would personally advise take a free forex course as you can learn just as much.


What is the difference between static memory versus dynamic memory?

Dynamic memory can be declared at run-time using the new and delete operators (or malloc and free in C), while static memory must be declared at compile-time.


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.