a yet another solution(for different granularity of generation time) wherein a unique random number can be generated more than once within a second......
struct timeval tv; gettimeofday(&tv, NULL); srandom((tv.tv_sec<<16)|(tv.tv_usec>>16)); uniquenum = random();
rgds, Rahul
Manish Jethani wrote:
Seed it using srandom((unsigned) time(NULL)) before any calls to random().
-Manish