> How to use srand and rand?
> I tried :
> cout << srand(2,12);
> cout << srand(12);
> cout << rand(12);
> these does not work.What i need is to get a random number from
> specified range of numbers min and max.from 6 to 12 for example.How to
> do that?
> And what is the difference between these two commands srand and rand?
Jeebus, dude. If you can't get any of this stuff from your book,
perhaps try to find one translated to your native language, or another
one that fits your learning style.
Anyways... you have the wrong idea about srand(). Its purpose is to
'seed' the random number generator. Using a seed will cause the random
number generator to produce a certain, fixed set of 'random' numbers.
This will answer your question a little better:
Hint for future questions like this: It was the first page that came up
when I did a google search.