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 / 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 View All Answers
What is the difference between prefix and postfix versions of operator++()?
What is constructor c++?
What is singleton pattern in c++?
What does namespace mean in c++?
Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).
Is rust better than c++?
How do you clear a map in c++?
If a base class declares a function to be virtual, and a derived class does not use the term virtual when overriding that class, is it still virtual when inherited by a third-generation class?
What would happen on forgetting [], while deallocating an array through new?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
What is the difference between method overloading and method overriding in c++?
What is the size of a vector?
What does catch(…) mean?
What is a type library?
Explain linked list using c++ with an example?