im trying to write a loop so that 8 of each card in a blackjack game is made and i cant get it to work right. it should print out 8 cards for each card made and delete the card if there are already enough of that type of card and loop through again untill a good card is found but its not doin that any suggestions??
where i need help
Code:int Card::counters[52] = {0}; for(int i = 0; i < DECKS*52; i++) { if(Card::counters[i] < DECKS) { // loop untill find good card card = new Card; card->print(); cout << endl; // push only if < max num of each card if(Card::counters[i] < DECKS) { deck.push(*card); } else { delete card; } } //if not delete card and loop again }



LinkBack URL
About LinkBacks


