Quote Originally Posted by chrismiceli
You didn't yield to my resonse. If you really want to use the current time to seed your random numbers you can get creative with some time.h functions, but you can't use directly time()'s return value portably.
If you type cast it you can.

Quote Originally Posted by bideyore
i followed quzah and chris, then write this program:

...snip...

i used gcc to compile and exexute,and get the right result.
if any potential problems,correct me.
If you want to take it a step further, use two command line arguments, one for the minimum number, and one for the top number, and generate a number randomly between those two.

Quzah.