Can copy constructor admit an object of the same class , C/C++ Programming

Assignment Help:

Can copy constructor admit an object of the same class as parameter, rather than reference of the object?

 


Related Discussions:- Can copy constructor admit an object of the same class

What is some instance of operator overloading?, A: Here are a few of the ma...

A: Here are a few of the many instance of operator overloading: myString + yourString may concatenate two std::string objects myDate++ may increment a Date object a * b may m

Write down the code for binary search tree in c++?, A: BinarySearchTree.h ...

A: BinarySearchTree.h ---------------------- #ifndef BINARY_SEARCH_TREE_H_ #define BINARY_SEARCH_TREE_H_ #include "dsexceptions.h" #include // For NULL // Binary

Loops, how to get plus asterisk pattern

how to get plus asterisk pattern

Record of student and calculating marks using ctotal, reocord of a student ...

reocord of a student and a function ctotal to calculate the marks of any three subject by using ctotal() function

Tells the operators one can override; which operators , Q:  Tells the opera...

Q:  Tells the operators one can override; which operators should he override? A: Bottom line: don't puzzle your users. Remember the reason of operator overloading: to decreas

3/15/2013 4:06:03 AM

A: No. this is specified in the definition of the copy constructor itself. It must generate an error if a programmer specifies a copy constructor along a first argument that is an object and not a reference.

 

3/15/2013 4:07:19 AM

constructor with a single argument creates that constructor as conversion ctor and it can be utilized for type conversion.

For instance:

class Boo

{

public:

Boo ( int i );

};

Boo BooObject = 10; // assigning int 10 Boo object

 

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd