The standard library functions like "rand()" are called a "pseudo-random number generators" for good reason: they follow an *algorithm" and, unless you do something *different*, they will give the *same* results each time you execute them.
Hence the need for a "seed". For example, read "time()", convert it to an unsigned int, and pass it as a seed the first time (and *only* the first time) you call "rand()". As ilikejam said, "read 'man rand' for enlightenment".
Hope that helps .. PSM
An even *better* source of random numbers under Linux is /dev/urandom: