Explain the difference between 'operator new' and the 'new'
operator?
Answer / 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 |
Is c++ faster than c?
What's the order in which the local objects are destructed?
How much maximum can you allocate in a single call to malloc()?
Explain the concept of inheritance in C++.
How to avoid changing constant values?
What is a .lib file in c++?
Explain the scope resolution operator?
Describe the main characteristics of static functions?
What is an adjust field format flag?
What is increment operator in c++?
Why is c++ not purely object oriented?
What do you mean by persistent and non persistent objects?