Mail Archives: djgpp/1999/11/08/13:24:59
From: | david_eg AT iname DOT com
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Hello, and HELLLLP!
|
Message-ID: | <3827f4cb.3443436@news.dsuper.net>
|
X-Newsreader: | Forte Agent 1.5/32.451
|
MIME-Version: | 1.0
|
Lines: | 38
|
Date: | Mon, 08 Nov 1999 16:14:05 GMT
|
NNTP-Posting-Host: | 205.205.142.118
|
X-Complaints-To: | abuse AT idirect DOT com
|
X-Trace: | quark.idirect.com 942077645 205.205.142.118 (Mon, 08 Nov 1999 11:14:05 EST)
|
NNTP-Posting-Date: | Mon, 08 Nov 1999 11:14:05 EST
|
Organization: | via Internet Direct - http://www.mydirect.com/
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hi
About a month ago I decided to tackle the 'C' programming language
for the first time. (my only experience programming on the PC prior
to this was with Quick Basic 4.5.) So I D/L'd DJGPP and it installed
with no problems, a quick test of the compiler "Hello World!" and
all was well. Next I installed Allegro and ran "make", again not a
single error. (the Force must be with me) Now I am well into the
conversion/rewrite/vast-improvement of one of my QB45 games and I
needed 'random' numbers, thanks to the FAQ I found the following
method for seeding and using random numbers..
srand(time (NULL)); /* this is the code to seed the generator */
aa = (rand () % 4 + 1); /* this gives a # between 1 and 4 */
Now my program compiles "-Wall" with only one warning.. (I'm pretty
proud of that fact being a newbie) and the warning does not point to
any of 'my' functions. I checked the Help on syntax and found that
"time", "srand", "rand" as well as "srandom" and "random" are valid.
calls/names in libc. This is the warning I get..
lxd.c:161: warning: implicit declaration of function `time'
In spite of this warning, my game seems to be running fine.
Q:What must I do to clear up this warning?
After all, I can't claim to be bug free if I'm getting warnings from
the compiler now can I. <grin>
BTW, I failed to find any docs that explain the warning and error
messages that spit out of the compiler, any help regarding this
would be apreciated.
Thank you for your time, and have a great day.
______________________________________________________________________
The "C" programing language is not a "Monster born of Chaos", it's the
"Ultimate Computer Role Playing Game" >, >, ;-), ;-), ! ? I mean?
- Raw text -