Passing two Dimensional Arrays
I am currently working on a black jack game for a school project. I decided to set up the deck to be used as a two dimensional array to symbolis the card amount and the card's suit. I currently believe I am running into trouble passing the arrays through certain functions though. I believe I have the general set up correct but my main question is if you can pass a const in the second half of the array as the number it. Here is how I currently have it set up.
Code:
const int suit_size = 3;
const int number_size = 12;
int setup(int[][suit_size], int, int*);
setup(deck[][suit_size], number_size, &player.money);
int deck[number_size][suit_size];
int setup(int deck[][suit_size], int number, int *money)
{
int j = 0;
for(int i = 0; i <= suit_size ; i++){
for(j = 0; j <= number; j++){
deck[j][i] = 0;
}
}
*money = 100;
}
This is not all the code I have just the code that should effect this question. My main question is it allowed to pass the area size in this fashion. If you have any other suggestions though that you believe might help me feel free to make any suggestions.