new and dispose

DELPHIer,

Are New and Dispose as same as new and delete in C++ ?

When do I need to use GetMem and FreeMem instead of New and Dispose ?

Andrew
andrewyuAsked:
Who is Participating?
 
julio011597Connect With a Mentor Commented:
Yes, they are the same.

The difference between New/Dispose and GetMem/FreeMem is in use:

New/Dispose want an object as argument, while GetMem/FreeMem want a size in bytes.

In other words, you can think of their difference as the difference in C++ between new/delete and *alloc/free.

HTH, julio
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.