www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/09/15:06:20

From: Jan_Diederich AT t-online DOT de (Jan)
Newsgroups: comp.os.msdos.djgpp
Subject: atof(...) Problem
Date: Sun, 09 May 1999 19:29:06 +0200
Lines: 12
Message-ID: <3735C5E2.AB4BEBE2@t-online.de>
Mime-Version: 1.0
X-Trace: news02.btx.dtag.de 926270298 26227 777000113016-0001 990509 17:18:18
X-Complaints-To: abuse AT t-online DOT de
X-Sender: 777000113016-0001 AT t-online DOT de
X-Mailer: Mozilla 4.07 [de] (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

If I use the "atof" function I get always "1.0000000":
{
  double d;
  char Test[80];

  strcpy(Test,  "123.456");
  d = atof(Test);
  printf("'%f'\n", d);       // result is  "1.000000"
}
If I give the number direct ( atof("123.456") ) or a pointer to
a string, I get always "1.0.....".

- Raw text -


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