From mboxrd@z Thu Jan 1 00:00:00 1970 From: Janis Johnson To: Reinaldo Nolasco Sanches Cc: gcc@gcc.gnu.org Subject: Re: atof() Date: Mon, 19 Aug 2002 11:09:00 -0000 Message-id: <20020819111113.A2220@us.ibm.com> References: <20020819174953.82701.qmail@web14402.mail.yahoo.com> X-SW-Source: 2002-08/msg01126.html On Mon, Aug 19, 2002 at 10:49:53AM -0700, Reinaldo Nolasco Sanches wrote: > > 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 > This mailing list is for questions about developing GCC, not about using it. A hint, though: try compiling with -Wall to turn on more warnings. Janis