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 whitespace in C++.
how is returning structurs from functions?Show an eg?
Why main function is special in c++?
What are the general quetions are in DEna bank manager IT/System interviews?
Which algorithm do you like the most? Why?
Which function cannot be overloaded c++?
Explain what happens when a pointer is deleted twice?
What are the advantages of c++?
Where is atoi defined?
What are the various arithmetic operators in c++?
class Foo { const int x; protected: Foo(int f); ~Foo(); }; Foo f; Referring to the sample code above, why will the class declaration not compile? a) The variable x is const. b) The destructor is protected. c) The destructor is not public. d) The constructor is protected. e) There is no default constructor.
What is the main purpose of c++?