Can someone plz email me the code on a random number. I know its something like srand(?????
plz email me it at [email protected]
ttttthanks
Can someone plz email me the code on a random number. I know its something like srand(?????
plz email me it at [email protected]
ttttthanks
Before Quzah finds this I would do a search for say, off the top of my head, srand.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
well..do this
#include <time.h>
#include <stdlib.h>
int main()
{
srand((usigned int)(time)(NULL)) // seeds it so get diff. num each time
int x;
x = rand() % 6 // this will make a random number 0-5, change the 6 to anythin you like
return 0;
}
i spell something wrong on the last post
#include <time.h>
#include <stdlib.h>
int main()
{
srand((unsigned int)(time)(NULL)); // seeds it so get diff. num each time
int x;
x = rand() % 6; // this will make a random number 0-5, change the 6 to anythin you like
return 0;
}
nextus, the samurai warrior
And easier way to seed off of time is:
srand(time(NULL));