I'M working my way through a C++ book and now I'M doing a card deck program. Here's the line I'M having trouble with.
r = card % 13; // r = random 0 to 12
card in this case is just a random int number from 0 to 51.
52 diveded by thirten is 4. So if the % operator returns the remainder of a random number from 0 to 51 then as far as I can tell it's always going to be a decimal, is it not? Not a whole number from 0 to 12 as the comment would have me believe. Also, how can an int even be a deciaml? Sorry, I know there something really simple I'M missing here.