K
Keith Thompson
[email protected] said:Keith said:[snip]srand((unsigned int)time((time_t *)NULL));
Both casts are unnecessary. As long as the prototypes for srand() and
time() are visible (which they are since you have the proper #include
directives), the conversions will be done implicitly. Just use:
srand(time(NULL));
(You do sometimes need an explicit cast when you're calling a function
with a variable number of parameters, such as printf.)
Ok, thanks for pointing that out.
BTW, I copied it from the FAQ (some of us _do_ actually look
at the FAQ first).
I've just sent a note to Steve Summit.