-
random number in C
I wrote a little program for a friend of mine that will randomly display a new guitar chord in intervals of the user's choosing. The only issue with it is that the random function produces the same exact "random" results every time the program is run. Right now I'm doing . Any other way of doing this that will produce truly random numbers?
-
you need to seed the rng first. Customary is to do something like srand(time()) or however you get the time... basically just call srand with a number that changes each run.
-
-
awesome, thank you very much