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
What is double in c++?
How a macro differs from a template?
What is ofstream c++?
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
What does count ++ do in c++?
What is the full form nasa?
What are the benefits of pointers?
Define stacks. Provide an example where they are useful.
Which software is best for c++ programming?
What is istream c++?
Write a program to find the Fibonacci series recursively.
What is near, far and huge pointers? How many bytes are occupied by them?
Which compiler does turbo c++ use?
Write about the members that a derived class can add?
Out of fgets() and gets() which function is safe to use?