delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/18/21:30:40

From: "Marp" <Marp AT 0 DOT 0 DOT 0 DOT 0>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Implicit what?
Date: Mon, 18 Oct 1999 20:59:33 -0400
Organization: MindSpring Enterprises
Lines: 20
Message-ID: <7ugfpq$ime$1@nntp3.atl.mindspring.net>
References: <7ugean$5qv$1 AT birch DOT prod DOT itd DOT earthlink DOT net>
NNTP-Posting-Host: c7.b7.cf.56
X-Server-Date: 19 Oct 1999 00:59:38 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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