Hey Callum,
Although I think you got what I was trying to say, allow me to be more specific...
I build and run the given code:
cout << rand() %6 << endl; //generates number from 1-6
and lets say I get 5.
After I close the program.
I build and run the program again and receive 5 again. and over and over.
I was wondering, if there is a way...where user's can get different random numbers each time. So the first time I might've gotten 5, but the next time I could get a 2 or a 4....
I understand that for the program the 5 might be a randomly generated number, but when its already a set, randomly generated number...it defeats the purpose.
I tried the given code you gave above....:
#include <iostream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <ctime>
int main ()
{
int numone;
srand(time(NULL));
cout << time << endl;
return 0;
}
BUT....again...I am simply getting the same number over and over again...
any other suggestions?