Mail Archives: djgpp/1999/10/19/00:01:48
Thanks, that did it. I had thought including random.h would do the trick;
apparently not.
~Rob
Marp <Marp AT 0 DOT 0 DOT 0 DOT 0> wrote in message
news:7ugfpq$ime$1 AT nntp3 DOT atl DOT mindspring DOT net...
> Mauro Guico <lpjr20 AT earthlink DOT net> wrote in message
> news:7ugean$5qv$1 AT birch DOT prod DOT itd DOT earthlink DOT net...
>
> <snip>
>
> > Now, it might sound like a
> > pretty dumb question (though I know, there are no dumb questions) but
when
> I
> > compile this, it is fine, yet when I try to run it, I get hit with an
> > 'implicit declaration of function 'int srand(...)'' and the same for
> > 'rand(...)' What's up with it? Thanks to everyone who reads this!
>
> "implicit declaration" of a function means that the compiler encountered
> your use of that function before encountering either its prototype or its
> actual definition. When that happens, the compiler has to guess its return
> type and what arguments it takes based on how you used it. In the case of
> srand()and rand(), these functions are prototyped in stdlib.h and
therefore
> you should #include it in your program. That will get rid of those
warnings.
>
>
- Raw text -