I'm confused about this
Donnie J. Glass
donnie at d.cs.okstate.edu
Wed Nov 21 15:42:14 AEST 1990
>From article <3945 at vela.acs.oakland.edu>,
by jmwojtal at vela.acs.oakland.edu (Wojo):
Jeff Wojtalewicz (Wojo) writes:
> I got this C program and this part I don't understand:
>
> int getpid();
> long now;
>
> now = time(&now) / rand();
> srand(getpid() + (int)((now >> 16) + now + time(&now)));
>
> What does "srand" do to be exact? It doesn't bring a value back?
> "getpid()" is declared, but the function is not in the program.
>
>
getpid() gets the process ID number for the process.
Similarly, getppid() returns the parent processes ID number.
----------------------------------------------------------------------
Don Glass
Oklahoma State University
donnie at d.cs.osu.edu
More information about the Comp.lang.c
mailing list