What will happen if I allocate memory using "new" and free
it using "free" or allocate sing "calloc" and free it using
"delete"?

Answer Posted / sanjay makwana, puna

When you allocate a memory using new then constructor will
be called but when use a free that time destructor will not
be called.

Same vice versa for calloc and delete.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to concatenate two strings.

677


What do you mean by delegate? Can a user retain delegates?

603


List the types of polymorphism in c++?

725


Define the process of handling in case of destructor failure?

667


What are member functions used in c++?

657






What is a breakpoint?

651


What is a c++ object?

713


How is objective c different from c++?

875


How do I use turbo c++?

623


What is a syntax in c++?

718


Explain object slicing in c++?

685


How does a C++ structure differ from a C++ class?

708


Can malloc be used in c++?

664


Which bit wise operator is suitable for turning off a particular bit in a number?

734


daily Routine of father

1013