Help making a multidemensional array.

Hi all. I'm trying to make a simple array to hold a "hand" of cards. There are six cards, so I need the first row of the array to hold the number on the card, and the second hand to hold the suit. I tried using this
1
2
3
4
    for (i = 0; i < 2; i++){
    hand [0][i] = rand() % 13 + 1;
        for (j = 0; j < 6; j++){
            hand [1][j] = rand() % 4 + 1; }


but the last four cards have enormous numbers. Any ideas?

Thanks
i should be going to 6, not 2. The last four values are garbage from the last program.

Cheers,

-Albatross

P.S: Card data is an example of what structs should be used for:
http://cplusplus.com/doc/tutorial/structures/
Topic archived. No new replies allowed.