B
Bill Cunningham
Adam said:Maybe adding process ID to the seed calculation would do the job.
Instead of:
srand(time(NULL))
Use:
srand(time(NULL) ^ getpid())
Or even:
srand(time(NULL) ^ (getpid() << 16))
Is that really that random? As long as a process has fork() 'ed and the
process is running it's pid isn't going to change is it until the system
kills it.btw to stay on-topic here that caret and those << indicators. I've
never seen that in C except maybe headers. Are they preprocessing tokens?
Bill