View RSS Feed


Entries with no category

  1. Copy constructors and assignement operators in c++

    by , 04-01-2013 at 08:41 AM
    Copy Constructor
    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

    CopyConstructorExample( const CopyConstructorExample& other );
      CopyConstructorExample( CopyConstructorExample& other );
      CopyConstructorExample( volatile const CopyConstructorExample& other );
      CopyConstructorExample( volatile
  2. Inheritane and Friend Functions

    by , 03-26-2013 at 09:22 AM
    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 ...