Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



What will happen if I allocate memory using "new" and free it using "free" or a..

Answer / 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

What will happen if I allocate memory using "new" and free it using "free" or a..

Answer / ekta

free is not compatible with new.
free wont recognise the memory allocated by new and should
gie some error i guess.

Is This Answer Correct ?    0 Yes 1 No

What will happen if I allocate memory using "new" and free it using "free" or a..

Answer / roshan p.r.

Hi,

you cannot free a memory allocated with new using "free"
and in the same way callac with "delete"

because they are incompatable

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More C++ General Interview Questions

If you don’t declare a return value, what type of return value is assumed?

0 Answers  


What is endianness?

0 Answers  


What is a tree in c++?

0 Answers  


What is expression parser in c++

0 Answers   Mphasis,


Write a program using display() function which takes two arguments.

0 Answers  


What is meaning of in c++?

0 Answers  


Is c++ free?

0 Answers  


What is constructor c++?

0 Answers  


Why is c++ so fast?

0 Answers  


write a program to add two numbers without using an arithmetic operator.

1 Answers   NIIT,


How can you quickly find the number of elements stored in a dynamic array?

0 Answers  


Write about the scope resolution operator?

0 Answers  


Categories