Random Generator
Posted: Sat Jun 19, 2004 5:18 pm
I am starting to program C++ and I need some help.
I wanted to create a random number minimum and maximum.
So I need a wildly random generating function: that one time based.
But how can I bring the random number that is over 100000 to 0-1 ?
I tried:
But in the result it brought me only the minimum OR the maximum, and nothing between them. Maybe somebody could tell me please how I could do that ? Thanks.
*EDIT*
Or yes... or do you know an another way to make a random number 0-1 ?
And yes... my beginner program here: http://s8.invisionfree.com/rocksndiamon ... &id=621544
I wanted to create a random number minimum and maximum.
So I need a wildly random generating function: that one time based.
Code: Select all
srand( (unsigned)time( NULL ) );
I tried:
Code: Select all
int R=(rand()%2);
*EDIT*
Or yes... or do you know an another way to make a random number 0-1 ?
And yes... my beginner program here: http://s8.invisionfree.com/rocksndiamon ... &id=621544