This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: atof()
- From: Erik Trulsson <ertr1013 at student dot uu dot se>
- To: Reinaldo Nolasco Sanches <r_linux at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 19 Aug 2002 20:18:36 +0200
- Subject: Re: atof()
- References: <20020819174953.82701.qmail@web14402.mail.yahoo.com>
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...
This is not the right list for this kind of question but I will answer
anyway. (This list is for discussion of the development of gcc, not
how to use gcc.)
If you use atof() you need to include stdlib.h first to get the
prototype. Otherwise the compiler will assume atof() returns an int
and thus generate bad code.
>
> I make a little example...
>
> #include <stdio.h>
>
> int main()
> {
--
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se
- References:
- atof()
- From: Reinaldo Nolasco Sanches