Message-ID: <3739ECCD.DECEE46C@unb.ca> Date: Wed, 12 May 1999 17:04:14 -0400 From: Endlisnis X-Mailer: Mozilla 4.51 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp 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> <37381702 DOT D1F1DDC4 AT accord-soft DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Info: BrunNet, Inc. 888-278-6638 Reply-To: djgpp AT delorie DOT com I get '446676599.000000' on my machine. Sunil V wrote: > You get "1.00000" if u have not included "stdlib.h". > > Endlisnis wrote: > > > 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 > > #include > > > > 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