• Log in or sign up for an account here: https://www.sythe.org/login

how do i make a random value?

Joined
Aug 28, 2011
Sythe Gold
77
Messages
1,195
Doge
I'm LAAAAAAAME
Basically i'm just startin 2 learn c++ and I'm screwin around but i cant seem to figure out how to say... make int value=(integer between 0 and 100) i googled it but all i figured out was something like this
Value=(rand()%100)+1;
I mean it spits out a number but its like 42 every time so how do i get a completely random integer between 0 and 100 every time?
Copy and paste the code here and i'll figure it out... or u can explain whatever

Thanx
 
No one would want to - the number generator needs to be seeded for it to actually generate "random" numbers.

Using the same seed causes the number generator to always produce the same sequence of numbers. Using different ones (time(0) is usually different each time it's called) causes different sequences of numbers to be produced each time.
 
Runescape Gamblingrunescape gambling
Back
Top