I have got a piece of coursework to do for the 10th of April that requires a random number generator and the ability to save and re-call the numbers. now as I have never used a R.N.G before I am absolutely stumped. I can get it to generate the numbers but can't quite seem to figure out how to store them.
Any help is appreciated.
*edit*
almost forgot, this is the generator I am using.
- Code: Select all
{
srand((unsigned)time(0));
float lowest=-10, highest=10;
float range=(highest-lowest)+1;
for(float index=0; index<8; index++){
rw1 = lowest+float(range*rand()/(RAND_MAX + 100));
cout << setprecision(2) << setiosflags(ios::fixed);
cout << endl;
system ("pause");
}