I'm trying to create a program that simulates blackjack to test some counting strategies. My program is having problems in the following (partial) function:
When I debug, I can't get past the last line here, and I get the message: "No source code available for this location." Then it allows me to look at the assembly, which I don't understand but will be happy to copy here if you guys need it to figure out what's wrong.Code:int * Carddeck::dealBlackJack(const int numPlayers) { if (numPlayers < 1 || numPlayers > 6) { cout << "Number of players must be between 1 and 6.\n"; return 0; } int numCards = 3 + (2 * numPlayers); // +1 in case we have to burn a card int * bjackHand; bjackHand = new int [numCards];
I don't see what's wrong with this dynamic allocation of memory.