www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/11/08:22:21

Message-ID: <37381702.D1F1DDC4@accord-soft.com>
Date: Tue, 11 May 1999 17:09:46 +0530
From: Sunil V <sunilv AT accord-soft DOT com>
Organization: Accord Software & Systems Pvt. Ltd.
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: atof(...) Problem
References: <3735C5E2 DOT AB4BEBE2 AT t-online DOT de> <37374CB3 DOT FB83B34C AT unb DOT ca>
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.
--------------E6BCB03253E8919DD83E18DC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

You get "1.00000" if u have not included "stdlib.h".

Endlisnis wrote:

> Jan wrote:
>
> > If I use the "atof" function I get always "1.0000000":
> > If I give the number direct ( atof("123.456") ) or a pointer to
> > a string, I get always "1.0.....".
>
>     This program compiles and runs just as I expect on my machine.  Try this
> on your machine, maybe you didn't include stdlib.h or something (even then it
> shouldn't get 1, it got some huge number for me).
>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main()
> {
>   double d;
>   char Test[80];
>
>   strcpy(Test,  "123.456");
>   d = atof(Test);
>   printf("'%f'\n", d);       // result is  "1.000000"
> }
>
> --
>      (\/) Endlisnis (\/)
>           s257m AT unb DOT ca
>           Endlisnis AT HotMail DOT com
>           ICQ: 32959047

--
_______________________________________________________________________

If your main flight is delayed, then your connecting flight is on time.
_______________________________________________________________________


--------------E6BCB03253E8919DD83E18DC
Content-Type: text/x-vcard; charset=us-ascii;
 name="sunilv.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Sunil V
Content-Disposition: attachment;
 filename="sunilv.vcf"

begin:vcard 
n:V;Sunil
tel;home:341 4609
tel;work:556 0136 / 138 / 105
x-mozilla-html:FALSE
org:Accord Software & Systems Pvt. Ltd.;Software Division
adr:;;;;;;
version:2.1
email;internet:sunilv AT accord-soft DOT com
x-mozilla-cpt:;-3328
fn:Sunil V
end:vcard

--------------E6BCB03253E8919DD83E18DC--

- Raw text -


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