Something stupid
Ok I have a problem with this
int a = z ();
int b = z ();
int z ()
{
srand (time(0));
return 1 + rand % 10;
}
With this all I get is the same value for a and b. What do I do if I need different value for a and b ???
You only need to call srand once, at the start of the program. It is being called everytime the function runs as it stands now.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement