Make sure you include an appropriate header file to get the strtod
definition, otherwise it will assume int. Try:

#include <stdio.h>
#include <stdlib.h>

void main()
{

char *ch;
float f;
ch = "2345.235";
f = strtod (ch,NULL);
printf("%f\n", f);
}

-tony


On 20-Mar-2000 Nilton S. Ramos Quorin wrote:
> Hello,
> I'm having trouble to do a string to double conversion. I have the
> following simple code which doesn't work:
> 
> char *ch;
> float f;
> ch = "2345.235";
> f = strtod (ch,NULL);
> 
> I compiled my code with a Glade make.  When i compile it with a
> simple
> gcc command, it works.
> I tried to set the environment variable LC_ALL to en_US
> Is there a gtk function for this special purpose?
> Thanks,
> Nilton
> 
> -- 
> To unsubscribe: mail -s unsubscribe [EMAIL PROTECTED] <
> /dev/null

---
E-Mail: Tony Gale <[EMAIL PROTECTED]>
Democracy is a form of government in which it is permitted to wonder
aloud what the country could do under first-class management.
                -- Senator Soaper

The views expressed above are entirely those of the writer
and do not represent the views, policy or understanding of
any other person or official body.

-- 
To unsubscribe: mail -s unsubscribe [EMAIL PROTECTED] < /dev/null

Reply via email to