Answer Posted / achal ubbott
Question on copy constructor is a classic one for an
interview. Since most modern day c++ compilers provide a
default copy constructor, most people don't get to try
hands over it. But in some cases it becomes mandatory to
define your own copy constructor and override the default
one.
So the places when CC is invoked are:-
1. calling a function e.g. void f(sample A);
2. creating an object from the existing object.
e.g. sample A=B; // here B is existing object.
3. When a function returns a copy of object.
e.g. sample f()
{
sample a;
return a;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Why do pointers exist?
Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.
Why do we use oops?
What is an example of genetic polymorphism?
What are oops functions?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
Why is polymorphism used?
officer say me - i am offered to a smoking , then what can you say
What does I oop mean?
Is react oop?
what are the realtime excercises in C++?
What is the main feature of oop?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
What is abstract class in oop?