How I can generate different random numbers in one moment in c++?
Now I use
while ( flag )
{
....
srand( time( NULL) );
int rndSig = rand() % 10 + 1;
......
}
But at one moment all numbers are equal. How I can generate different numbers in while loop?
Move the srand outside of the while loop. You only need to call it once, rand() keeps static state.