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
Why is c++ called oops?
Write a program to show polymorphism in C++?
What does iomanip mean in c++?
Why null pointer is used?
How would you use the functions memcpy(), memset(), memmove()?
What are the characteristics of friend functions?
what are the decision making statements in C++? Explain if statement with an example?
How many types of comments are there in c++?
What do you mean by overhead in c++?
What is data hiding c++?
What is abstract keyword in c++?
What are all predefined data types in c++?
why and when we can declar member fuction as a private in the class?
Write a note about the virtual member function?
What is the purpose of extern storage specifier?