minus-squareal4s@feddit.detoProgramming@programming.dev•[SOLVED] [C] Blackjack game - array has 0s in first 24 elements immediately after initialising with values from 1 to 13linkfedilinkarrow-up4·10 months agoplayer_hand and dealer_hand are only [DECK_SIZE/2] in length, but in initialize_decks you write zeros into them unti [DECK_SIZE -1]. Since the arrays are located next to each other in memory you end up overwriting the deck array. linkfedilink
player_hand and dealer_hand are only [DECK_SIZE/2] in length, but in initialize_decks you write zeros into them unti [DECK_SIZE -1]. Since the arrays are located next to each other in memory you end up overwriting the deck array.