Hello,

I want to make a char array of a deck of playing cards. I have a 2-d char array called deck[52][2]. where each object in the array has a card value(1-10,J,Q,K,A) and a suit value(S,C,D,H). I made this loop to put the values into the array however i cant get the 1-10 values in because it thinks these are ascii values. My question is how do i make it so that i can put these int values into the char array without having to put them in one by one? Thanks a bunch!

heres my code:

Code:for ( int i = 0; i == 51; i++ ) { if ( i < 13 ) { deck[i][1] = 'H'; if (i == 0){ int temp = 2; } if (temp < 11) { deck[i][2] = temp; temp ++; } else if (temp == 11){ deck[i][2] = 'J'; temp ++; } else if (temp == 12){ deck[i][2] = 'Q'; temp ++; } else if (temp == 13){ deck[i][2] = 'K'; temp ++; } else if (temp == 14){ deck[i][2] = 'A'; temp = 2; } } if (i > 12 && i < 26) { deck[i][1] = 'D'; if (temp < 11) { deck[i][2] = temp; temp ++; } else if (temp == 11){ deck[i][2] = 'J'; temp ++; } else if (temp == 12){ deck[i][2] = 'Q'; temp ++; } else if (temp == 13){ deck[i][2] = 'K'; temp ++; } else if (temp == 14){ deck[i][2] = 'A'; temp = 2; } } if (i > 25 && i < 39) { deck[i][1] = 'C'; if (temp < 11) { deck[i][2] = temp; temp ++; } else if (temp == 11){ deck[i][2] = 'J'; temp ++; } else if (temp == 12){ deck[i][2] = 'Q'; temp ++; } else if (temp == 13){ deck[i][2] = 'K'; temp ++; } else if (temp == 14){ deck[i][2] = 'A'; temp = 2; } } if (i > 38 ) { deck[i][1] = 'S'; if (temp < 11) { deck[i][2] = temp; temp ++; } else if (temp == 11){ deck[i][2] = 'J'; temp ++; } else if (temp == 12){ deck[i][2] = 'Q'; temp ++; } else if (temp == 13){ deck[i][2] = 'K'; temp ++; } else if (temp == 14){ deck[i][2] = 'A'; temp = 2; } } }