From: "Berti Drost" Newsgroups: comp.os.msdos.djgpp Subject: Re: how to use atof? Date: Sun, 5 Sep 1999 16:24:30 +0200 Organization: NEFkom Telekommunikation GmbH Message-ID: <7qufgt$3hm$1@thetenth.astat.de> References: <7qr9uh$3fk$1 AT thetenth DOT astat DOT de> NNTP-Posting-Host: dialup66.nefonline.de X-Server-Date: 5 Sep 1999 19:15:41 GMT X-Newsreader: Microsoft Outlook Express 4.71.1712.3 X-MIMEOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Lines: 34 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Ah...I've found the error...still strange: If I add #include it works correctly, if I don't, it can be compiled, but atof returns strange numbers; I wonder why... (Thanx, Steven) BertI Berti Drost schrieb in Nachricht <7qr9uh$3fk$1 AT thetenth DOT astat DOT de>... >Hello, >I have some troubles useing the command atof (convert string to double); >the following code isn't produceing the correct results. Can anybody tell me >what the mistake might be? (It occures also, if I use strtod; on the other >hand, atoi (convert str to integer) is working perfectly:-( ) > >int main(int argc, char *argv) >{ > char *zahl="153.34"; > char *err; > double out_f; > out_f=atof(zahl); >// out_f=strtod(zahl,&err); > printf("strtod() : %f\n",out_f); > printf("err=%c\n",*err); > return(0); >} > >Thanx, >BertI > >