srand
srand expr
- Sets the random number seed for the
randoperator so thatrandcan produce a different sequence each time you run your program. If expr is omitted, a default seed is used that is a mix of difficult-to-predict, system-dependent values. If you callrandand you haven't calledsrandyet,randcallssrandwith the default seed.