To elaborate, a call to rand() generates psuedo-random numbers, or "random" numbers that follow a mathmatical pattern. This, of course, isn't truly random, so a "seed" is thrown in to change the pattern of rand() to appear not so random. srand() accmoplishes this, and by passing an ever-changing arguement like system time to srand ( srand( time( 0 ) ) ) you get the effect of actual random numbers.
rand() "returns a value between(inclusive) 0 and and RAND_MAX (defined by the compiler, often 32767). " so to get a random number between a certain range say 0-10, you need to use the modulus operator to shrink the range: rand() % 11. If you want to get a random number between, say 5 and 15 you simply do as above, but use an offset ( 5 in this case so... rand % 11 + 5 ).