delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/19/00:01:48

From: "Robert Guico" <lpjr20 AT earthlink DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Implicit what?
Date: Mon, 18 Oct 1999 22:15:22 -0500
References: <7ugean$5qv$1 AT birch DOT prod DOT itd DOT earthlink DOT net> <7ugfpq$ime$1 AT nntp3 DOT atl DOT mindspring DOT net>
X-Posted-Path-Was: not-for-mail
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-ELN-Date: 19 Oct 1999 03:15:47 GMT
X-ELN-Insert-Date: Mon Oct 18 20:25:01 1999
Organization: EarthLink Network, Inc.
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MSMail-Priority: Normal
Lines: 32
NNTP-Posting-Host: dialup-209.244.65.6.chicago1.level3.net
Message-ID: <7ugnp3$gnh$1@fir.prod.itd.earthlink.net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019