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 are the unique features of C++.
Why is "using namespace std;" considered bad practice?
Can we define function inside main in c++?
What is the use of endl in c++?
What is low level language in simple words?
What is a string example?
How the programmer of a class should decide whether to declare member function or a friend function?
What is a hash function c++?
how to connect with oracle 9i with server in socket program in c/c++
Write about all the implicit member functions of a class?
Explain the problem with overriding functions
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
Why is c++ not purely object oriented?
What is the basic difference between C and C++?
Distinguish between a # include and #define.