Explain the difference between 'operator new' and the 'new'
operator?
Answer Posted / richa
The term "operator new" is used incase when u are
overloading the global "new" operator.We can overload ne
operator just as any other operators i.e +,-,*,=etc.
The term "new operator" is used in case of dynamic
allocation of memory.When a variable is allocated memory
dynamically the new operator is used.
Eg:
int *p=new int;
//here p is pointer to integer.So in order to allocate
memory for it we have used the new operator.
| Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
What happens when you make call 'delete this;'?
Describe the setting up of my member functions to avoid overriding by the derived class?
What is virtual methods?
What is the exit function in c++?
Differences between private, protected and public and give examples.
If dog is a friend of boy, is boy a friend of dog?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?
You want to link a c++ program to c functions. How would you do it?
Can member functions be private?
an integer constant must have atleast one a) character b) digit c) decimal point
Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort
How a new element can be added or pushed in a stack?
Explain polymorphism?
What is setf in c++?