0

What is the purpose of srand48 in breakout.c? I understand how we should us drand48 later on but I don't understand the purpose of this line.

Thanks!

5
  • srand in general? or srand48? – SebBr Nov 6 '14 at 17:27
  • Sorry I didnt specify. I meant why is it being called in main? I understand its to generate pseudorandom numbers but not sure why we call it in main. – user2137 Nov 6 '14 at 17:32
  • So the srand(seed) seeds rand() which returns the actually number that is generated? – user2137 Nov 6 '14 at 18:12
  • @mECH yes, srand seeds rand while srand48 seeds drand48, lrand48, or mrand48. Execute man srand48 in the terminal for more information! – kzidane Nov 7 '14 at 9:47