sonic0568 said:
what's the difference between rand() & random() ?
rand() is a standard C library function, prototyped in the <stdlib.h>
header. It produces, on successive calls, a series of pseudo-random numbers
in the range 0 to RAND_MAX. You can set the starting point in that series
by passing it to srand(), which is also a standard library function.
random() is whatever you want it to be, subject only to your skill and
imagination. Implementations are free to provide extra functions as an
extension if they wish, and they have to call them something, so you might
want to have a look at your documentation to see whether random() is
mentioned there. If it is, bear in mind that some other implementation
might implement that function with different functionality, or not
implement it at all.