www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/20/19:01:29

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Atof() problem
Date: Fri, 20 Feb 1998 18:45:19 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 17
Message-ID: <34EE158F.6B2C@cs.com>
References: <34EDB0B4 DOT A7D AT kcl DOT ac DOT uk>
NNTP-Posting-Host: ppp231.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ben Leslie wrote:
> 
> I am trying to port a C program from UNIX to the PC using DJGPP.
> Eveything was going swimmingly, until I hit this problem. Calls to atof
> return zero. Is this a bug, or am I doing something wrong?

Try putting #include <stdlib.h> in your code.  If you don't provide a
declaration for atof(), the compiler assumes it returns an int, which
obviously won't work.

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "If 'everybody knows' such-and-such, |
|       aka Fighteer I       | then it ain't so, by at least ten    |
|   mailto:fighteer AT cs DOT com   | thousand to one."                    |
| http://www.cs.com/fighteer |                 - Lazarus Long       |
---------------------------------------------------------------------

- Raw text -


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