Constructors are often overloaded, meaning there are a number of functions with
the same name. They are differentiated by the type signature, and the
arguments used in the function call or declaration:
class PlayingCard {
public:
PlayingCard ( ) // default constructor,
// used when no arguments are given
{ suit = Diamond; rank = 1; faceUp = true; }
PlayingCard (Suit is) // constructor with one argument
{ suit = is; rank = 1; faceUp = true; }
PlayingCard (Suit is, int ir) // constructor with two arguments
{ suit = is; rank = ir; faceUp = true; }
};
PlayingCard *cardOne = new PlayingCard();
PlayingCard *cardTwo = new PlayingCard(Heart);
PlayingCard *cardThree = new PlayingCard(Diamond, 7);