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

What is c++ hiding?

0 Answers  


Const char *p , char const *p What is the difference between the above two?

0 Answers   TCS,


I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?

0 Answers  


Is c++ the best programming language?

0 Answers  


wrong statement about c++ a)code removably b)encapsulation of data and code c)program easy maintenance d)program runs faster

11 Answers  


What is ios :: in in c++?

0 Answers  


What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required

0 Answers  


What happens if a pointer is deleted twice?

0 Answers   Flextronics,


Any one help me plzzzz..... i have an assignment...... that is ______*********_______ Write a program that takes an equation as a string and does the following: Solve 8 parts to achieve 100% 1 - 5 are compulsory. Input: 2x^2+3x+4=0 1) read a quadratic equation 2) print its coefficients (coefficients range is 0 to 9) 3) print the solution of the equation 4) tackle imaginary solution e.g. ( (2+3i), (2-3i) ) 5) allow spaces within the input 6) after solving one equation; ask for an other, terminate on empty line. * 7) tackle negative values as well * 8) tackle more than one values of same exponent (e.g. 2x^2 + 3x^2 + 4x + 3 = 0)* 9) use strtok * 10) print the solution in fractions e.g. 1.5 should be printed as (1)1/2 * 11) coefficient can be greater than 9** 12) values on both sides of the ‘=’ sign** 13) plot the graph of the polynomial** 14) use a compiler other than Borland** 15) submit before May 25, 2009 11:59 PM ** _______******________ plz send me c++ code at sweety.alvi@gmail.com

1 Answers  


Can the creation of operator** is allowed to perform the to-the-power-of operations?

0 Answers  


How can you link a c program with a c function?

0 Answers  


A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one litre of milk is $0.38, and the profit of each carton of milk is $0.27. Write a C++ program that prompts the user to enter the total amount of milk produced in the morning. Then display the number of milk cartons needed to hold milk, the cost of producing milk, and the profit for producing milk.

2 Answers  


Categories