How to seed rand with a number range

I am seeing all sorts of ways to seed rand with time. What I hope to find out is how to seed rand with a range of 1 - 52. I am writing a function to cut a deck of cards at a random cut in the deck.

Thank you in advance for your help.

Chris
rand() % 52 + 1; generates a random number in the range 1-52.
That's not what seeding is for; your call to srand is simply to provide a starting point for the random number generation algorithm. (Have a google search for more information about Random Number Seeding)

rand() generates a number from 0 to INT_MAX - so if you want to restrict to a narrower range, then the typical approach is to calculate the modulus of your random number and your range
Thank you very much.
Topic archived. No new replies allowed.