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
Tell me can a pure virtual function have an implementation?
Which function cannot be overloaded c++?
What is command line arguments in C++? What are its uses? Where we have to use this?
Write a program to show polymorphism in C++?
What is this pointer in c++?
Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).
Distinguish between new and malloc and delete and free().
How is computer programming useful in real life?
Can we use this pointer in a class specific, operator-overloading function for new operator?
What is a multimap c++?
Why do we use classes in programming?
Name four predefined macros.
What is a flag in c++?
What is the use of ::(scope resolution operator)?
If I is an integer variable, which is faster ++i or i++?