I am having trouble getting rand() to work in C++. rand() normally gives me a very large number. When I try to use the modulo operator (%) to give it a range, it always returns 0, no matter what.
Seeding the random number generator at the beginning of the program doesn’t help either.
The following code works just fine for me (emitting a random number between 0 included and 1000 excluded each time it’s run):