When you call srand() inside a function, is that just the seed of rand() inside that function?
Here is the main function where srand() called.
int main(){ srand(static_cast<unsigned int>(time(0))); random_number(); } void random_number(){ rand(); }
The random_number function, where rand() used outside of where srand() was called.
So my question is: if you populated rand() with srand() , can you use seeded rand() outside of where srand() was called? Including functions, various files, etc.
source share