From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reinaldo Nolasco Sanches To: gcc@gcc.gnu.org Subject: atof() Date: Mon, 19 Aug 2002 10:49:00 -0000 Message-id: <20020819174953.82701.qmail@web14402.mail.yahoo.com> X-SW-Source: 2002-08/msg01122.html I have a problem with atof()... and I don't understand because it... When I use atof() to get a value of a string... and put in my double var, the value is not the same... I make a little example... #include int main() { double teste; char strteste[10]; strcpy( strteste, "120.1" ); teste = atof( strteste ); printf( "\n\tResult is = %.2f\n\n", teste ); return 0; } and the result is this Result is = 1078984704.00 and I don't understand this... I make this in several PCs... and in a SuSE, in a Slackware and in a RedHat(urgg!), and in all the erro ocurred... I don't know if I need set a specific #define... or a specific environment var... Please... anybody can help me ??? I compiled with... gcc -i teste.c -o teste Thanks a lot in advance... ===== "When you know Slackware, you know Linux... when you know Red Hat, all you know is Red hat" - Anyone seen smoking will be assumed to be on fire and will be summarily put out. - Power doesn't corrupt people, people corrupt power. - r_linux@yahoo.com -- http://slackware.linuxbr.org - UIN: 42853394 - irc.brasnet.org(#slackware) __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com