What happens to the member function in the class when copy constructor is invoked?

Showing Answers 1 - 3 of 3 Answers

vinod kumar

  • Nov 26th, 2007
 

Only member function should have authority to invoke any other member function.
But constructor is used to initialise the values to data members. they are constant it cannot be invoked any other constuctor. If they are copied compiler should not understand what is member function and what is constructor, so ambiquity will be raised.

  Was this answer useful?  Yes

bishoy

  • Jan 10th, 2008
 

Member functions, not as a lot of people expect; have only one instance loaded in memory when the program is run. All constructors included copy constructor target loading member variable, but member functions have their single instances always loaded in memory and ready to be called.

Well, the basic answer is not possible to call copy constructor explicitly within  a function again.  Because, in the member function it tries to shadow the parameter which is defined at the caller side. 

Hence, we cannot invoke copy constructor inside a function.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions