Unexplained Segfault

This is a discussion on Unexplained Segfault within the C Programming forums, part of the General Programming Boards category; Hey all,
I can't for the life of me figure out why this is segfaulting... sorry to bother you all ...

> srand(getpid()*time());
time() has a parameter, but the compiler doens't know that because you didn't include the right headers.
So the unpassed pointer is just any old thing which is lying around on the stack, which time() duly trashes (probably the return address from main back to the OS).

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell