View Single Post
Old Jan 2nd, 2006, 2:52 AM   #2
InfoGeek
Professional Programmer
 
InfoGeek's Avatar
 
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4 InfoGeek is on a distinguished road
call srand() from your main function only once. The reason you're getting the same result is that the for loop is executed within a few milli-seconds and the seed is set to almost the same time, resulting in the same random number each time.
__________________
PFO - My daily dose of technology.
InfoGeek is offline   Reply With Quote