0

What does this mean? I'm aware that this should be the constructor for an instance in the Deck class, but I don't understand the syntax myCards(DECKSIZE), debugging(debug) after Deck(bool debug)?

Deck::Deck (bool debug): myCards(DECKSIZE), debugging(debug) {
    for (int k=0; k<DECKSIZE; k++) {
        myCards[k].ChangeCard(k);
    }
    Shuffle ();
}

Thanks for helping.

Kashif
  • 3,063
  • 6
  • 29
  • 45
  • That's where the constructor calls for all of the data members go. –  Sep 24 '15 at 22:26
  • 1
    Possible duplicate: http://stackoverflow.com/questions/1711990/what-is-this-weird-colon-member-syntax-in-the-constructor? – Tas Sep 24 '15 at 22:28

1 Answers1

1

It initializes member object myCards with DECKSIZE.

Can't see myCards member declaration, but I think it is declared like Cards myCards, where Cards is a class, which constructor accepts size of the cards deck.

vladon
  • 8,158
  • 2
  • 47
  • 91