A copy constructor is a special constructor for a class/struct that is
used to make a copy of an existing instance.
The below are the syntaxes of the copy constructors
Code:CopyConstructorExample( const CopyConstructorExample& other ); CopyConstructorExample( CopyConstructorExample& other ); CopyConstructorExample( volatile const CopyConstructorExample& other ); CopyConstructorExample( volatile
The private and protected members of a class cannot be accessed from outside the same class
but it is not applicable for FRIEND functions
The friend functions or classes declared with the friend keyword.
If we want to declare an external function as friend of a class, thus allowing this function to have access to the private and protected members of this class, we do it by declaring a prototype of this external function within the class, and preceding it with the