In my code I used srand(time(0)); more than once.
In each of my functions I had it.
So is that bad? or if i use it once will it for ever randomly generate numbers even in a loop?
> In my code I used srand(time(0)); more than once.
> In each of my functions I had it.
> So is that bad?
Yes. Time increases monotonically in a predictable manner; you won't get pseudo-randomness.
> if i use it once will it for ever randomly generate numbers even in a loop?
Not for ever. A pseudo random number generator has a cycle, after which it will repeat the same sequence of numbers all over again. For std::rand() the cycle would typically be about 231 or so; and std::mt19937 has a cycle of about 219937. These numbers are large and should be adequate for your requirements.
Prefer the C++11 random number library over std::rand()