Answer Posted / namitha
A copy constructor is used in the following cases.
-When an object is created from another object of the same
type.
-When an object is passed by value as a parameter to a
function.
-When an object is returned from a pointer.
-when we want to set a default value for the data members.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
If all is successful, what should main return a) 0 b) 1 c) void
What is vector processing?
How do you flush std cout?
Specify some guidelines that should be followed while overloading operators?
Explain what you mean by a pointer.
What is friend class in c++ with example?
What is split a string in c++?
Which bit wise operator is suitable for putting on a particular bit in a number?
What are built-in functions? What is the syntax for the definition?
Describe linked list using C++ with an example.
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
What are static member functions?
Does c++ have a hash table?
Mention the storage classes in c++.
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .