www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/09/22:46:32

From: "J.D. Piette" <pjames AT lynx DOT dac DOT neu DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Problem with DJGPP?
Date: Wed, 09 Apr 1997 19:11:38 -0400
Organization: IBM Microelectronics Division
Lines: 24
Message-ID: <334C222A.4F9@lynx.dac.neu.edu>
NNTP-Posting-Host: nschips.btv.ibm.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,

I recently downloaded DJGPP(the GCC2721 version) and RHIDE v1.2 and got
everything set up and running fine.  BTW I think the program is
wonderful and I am thoroughly enjoying using it.

My problem is that when I call the function atof(), it returns a value
of 1.00. Here is the code segment.

   char buffer[80];
   double price;
   ....
   ....
   printf("\n\nCurrent Price?");
   gets(buffer);
   if(buffer[0]!='\0')
   {
      price=atof(buffer);
   }

price always has a value of 1.00.  I looked at it in the debugger and
buffer has the correct value and if I use atoi() the correct number is
assigned to price(the integer value).  Any information as to why this is
happening would be greatly appreciated.  Please reply by e-mail.

- Raw text -


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