Need Help

May 30, 2014 at 9:31pm
1
2
3
time_t qTime;
time(&qTime);
srand((unsigned int)qTime);


What does time(&qTime); mean? Thanks.
May 31, 2014 at 6:42am
What it is doing is passing a reference to qTime to the time function. This allows it to directly modify qTime, so that it will receive the details of the current time. Just note, if all you are doing here is seeding the random number generator, a more common approach is to do this:
srand(time(0));
Topic archived. No new replies allowed.