0
How do i make a randomizer in C that works
Help me to make a randomizer in C!!!
5 ответов
+ 1
you can include stdlib.h (iirc) which contains the rand() and srand() methods
+ 1
what hinanawi means is that you need to set a random seed everytime you open a prpgram, and that can be done with time(NULL) which will be different everytime is opened.
0
use /dev/random if on linux. no need for randomizer
0
i tried but its giving me the same number over and over again
0
Shreeniket Upasani that's because you have to do srand(time(NULL)) every time you want a new number generated
(time.h should be included also)