Hi, I'm looking for a way to generate random numbers and no idea how, I've tried looking around the web but no examples seem to compile for me, it's likely to do with not having the correct libraries which no archives seem to mention. Lots of posts mention the "time" function but I've never heard of it before and it doesn't compile when I use it.
Any info on syntax to use and which libraries to include would be much appreciated. :)
But don't forget to call srand() once, near the beginning of main, to seed the random number generator. Bourgond Aries's example gives me 41 every time I run it.
See the the reference entry of rand for a more complete example.