View Single Post
  #4 (permalink)  
Old 10-19-2007, 07:09 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 790
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default

That little section of code appears after every single one of his posts. Its like his signature, so just ignore it. That confused me when I first started here too.

As for the unique random numbers...the rand() function generates pseudorandom numbers. If you seed it with the same number you'll get the same outputs. You did the right thing by seeding it with the time, but to make it even more random, try:

Code:
srand(time(NULL));
int i,seed;
for(i = 0; i < rand() % 100; ++i)
{
    seed = rand();
    srand(seed);
}
This will loop around a random number of times and keep reseeding the random number generator. Otherwise, your code looks great.
Reply With Quote