What is difference between shallow copy and deep copy? Which is default?
Default version of clone method creates the shallow copy of an object. To create the deep copy of an object, you have to override clone method. Shallow copy is preferred if an object has only primitive fields. Deep copy is preferred if an object has references to other objects as fields.
Is This Answer Correct ? | 0 Yes | 0 No |
Do the names of parameters have to agree in the prototype, definition, and call to the function?
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 are structures and unions?
write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.
What are the benefits of c++?
What is the syntax for a for loop?
Can you use the function fprintf() to display the output on the screen?
What are the methods of exporting a function from a dll?
What is the output of the following 3D Array int arr[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12}; what is the output for arr[2][1][0]?
6 Answers HCL, Integra, IPMC, ORG,
Why do we need runtime polymorphism in c++?
if there is binary tree which one is the easiest way to delete all child node?
What is guard code in c++?