Theocacao
Leopard
Design Element
Comment on "Intro to Memory and Arrays in C"
by Chuck — Sep 14
@Gordon: rand() and srand() are defined in stdlib. You can find out about any standard function with the man command in the Terminal. So you could type "man srand" and it would tell you:

NAME rand, srand, sranddev, rand_r -- bad random number generator LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include

...followed by a whole bunch more information about what the functions do and how they're used.

By the way, random() and srandom() are better for getting random numbers (which is why the manpage for rand() says it's a "bad random number generator"). rand() and srand() are mainly there for compatibility.
Back to "Intro to Memory and Arrays in C"
Design Element

Copyright © Scott Stevenson 2004-2015