J
johnty
i'm facing a rather baffling problem:
calling a function in a FOR loop. the function has the following
lines:
clock_gettime(CLOCK_REALTIME, &time_stamp);
srand(time_stamp.tv_nsec);
the idea is each time it is called the random number generator is
seeded with the current nanosecond counter.
the program causes a seg fault when running in linux after 2 loops,
but not in cygwin. when the two lines are commented out, the code runs
fine in both.
any ideas why? or could the problem actually be somewhere else?
thanks!
johnty
calling a function in a FOR loop. the function has the following
lines:
clock_gettime(CLOCK_REALTIME, &time_stamp);
srand(time_stamp.tv_nsec);
the idea is each time it is called the random number generator is
seeded with the current nanosecond counter.
the program causes a seg fault when running in linux after 2 loops,
but not in cygwin. when the two lines are commented out, the code runs
fine in both.
any ideas why? or could the problem actually be somewhere else?
thanks!
johnty