Date: Mon, 6 Sep 1999 09:43:22 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Berti Drost cc: djgpp AT delorie DOT com Subject: Re: how to use atof? In-Reply-To: <7qufgt$3hm$1@thetenth.astat.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 5 Sep 1999, Berti Drost wrote: > If I add > #include > it works correctly, if I don't, it can be compiled, but atof returns strange > numbers; I wonder why... Because C assumes that any function without a prototype returns an int. includes a prototype of `atof' that says it returns a double, but if you omit it, the compiler generates code that interprets the value returned by `atof' as an int, which indeed will produce very strange results. You should *always* include the headers with the prototypes of all the library functions your program uses. That is why the documentation for every function in the DJGPP library reference always shows you what header has the prototype.