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 |
Define virtual constructor.
Does c++ have string data type?
Differentiate between realloc() and free().
What is name hiding in c++?
What is an inclusion guard?
How can you create a virtual copy constructor?
What is "map" in STL?
Explain "passing by value", "passing by pointer" and "passing by reference" ?
Do class declarations end with a semicolon? Do class method definitions?
What is an undefined reference/unresolved external symbol error and how do I fix it?
Can we make any program in c++ without using any header file and what is the shortest program in c++.
What is rvalue?