Is there a new/delete equivalent of realloc?
Answer / rohit sah
No. It would have a number of difficult problems. Some of these are:
- Should the old instances in the memory be deleted and re-instantiated?
- How about contained classes?
- How about instances owned by the classes to be reallocated? These often have a pointer to their owner.
| Is This Answer Correct ? | 0 Yes | 0 No |
Define namespace in c++?
How do you differentiate between overloading the prefix and postfix increments?
What is a stack c++?
What is a flag in c++?
Describe friend function & its advantages.
What c++ is used for?
Describe new operator?
What is the difference between a copy constructor and an overloaded assignment operator?
4 Answers Belzabar, Citrix, Microsoft, Wipro,
What is c++ prototype?
Given the following function definition: int doit(int &x, int y, int &z) { x = 3*x; y = y + 5; z = x+y; return z - 4; } int a = 5, b = 7, c = 9, d = 11; d = doit(a,b,c);
What is Virtual Inheritance?
What is virtual destructors? Why they are used?