Allocation with new operator and Destroying with free operator

S

saikishore.vanga

Hi,
I want to know whether if we are allocating with new operator
..Whats happening if we are deleting with FREE operator.If it is not
possible. What is the problem.
and also if new and Delete be overloaded. How can overload new and
delete operator?
Plz If You have answer Give to me reply.
Thanks
Saikishore
 
M

mlimber

Hi,
I want to know whether if we are allocating with new operator
.Whats happening if we are deleting with FREE operator.If it is not
possible. What is the problem.
and also if new and Delete be overloaded. How can overload new and
delete operator?
Plz If You have answer Give to me reply.
Thanks
Saikishore

First, there is no such thing as a "free operator". There is a free
function and a delete operator.

Second, see this FAQ:

http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#faq-16.3

In essence, new and delete do not need to rely on malloc/free to get
memory, and just because one implementation does it that way doesn't
mean all do. The standard leaves compiler implementers free to do it
differently if they so choose.

Cheers! --M
 
V

Victor Bazarov

I want to know whether if we are allocating with new operator
.Whats happening if we are deleting with FREE operator.

There is no such thing as "FREE operator". Please rephrase.
>If it is not
possible. What is the problem.
and also if new and Delete be overloaded. How can overload new and
delete operator?

Please refer to FAQ or your favorite C++ book.
Plz If You have answer Give to me reply.

If it means what I think it means, then no. Post here, read here.

V
 
E

Earl Purple

mlimber said:
First, there is no such thing as a "free operator". There is a free
function and a delete operator.

If there's a free function can I have an invite?
 
B

BobR

Earl Purple wrote in message
If there's a free function can I have an invite?

Sure! We've even invited a one-eyed one-horned flying Purple people eater!!

Now go to your room, and don't come out until you can explain recursion
recursively!!
 
B

BobR

Marcus Kwok wrote in message ...
Recursion: see definition for "Recursion"

HEY!!! I thought it was stated in the FAQ that we not do peoples homework for
them!! :-}
 
N

Neil Cerutti

Marcus Kwok wrote in message ...

HEY!!! I thought it was stated in the FAQ that we not do
peoples homework for them!! :-}

It's OK. He left out the base case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top