random number

This is a discussion on random number within the C Programming forums, part of the General Programming Boards category; I am working on my own project that is eventually going to simulate a poker game, and give each player ...

A bunch of flags. Ace through King take 0 through 12 in the array for one suit, then 13 through 25 for another suit, and so on. If the flag is 1, meaning the card is available, then it can be chosen. Once chosen, the flag is set to 0 to indicate it cannot be used again. If the random draw returns a card with the flag at 0, then the draw must be repeated until it gets something with a 1. When the card is put back, the flag is set back to 1 so it can be redrawn. Player hands could be done in a very similar way, except, perhaps, using a card ID instead to save on memory (as long as fewer than 6 cards are needed anyway).

Well what did you expect, we're not going to give you flat out code. You asked how to make a deck, I said with structures and that was the right answer. Now, since what now I believe you meant to say is : "How do I represent a deck with structures ?" here's how you'd do that :

All you do is have a card structure which is bascially 2 intergers, one interger represents the card's value, the other represent's the card's suit. Then, your deck would just be an array of 52 of these structures, as Salem has posted above.