From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: atof(...) Problem Date: Mon, 10 May 1999 17:16:36 -0400 Organization: BrunNet Lines: 31 Message-ID: <37374CB3.FB83B34C@unb.ca> References: <3735C5E2 DOT AB4BEBE2 AT t-online DOT de> NNTP-Posting-Host: ftnts3c30.brunnet.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.51 [en] (Win95; U) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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 #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