strtod() asking for ',' like decimal point???
- From: Marcelo David <mdsbrasil yahoo com br>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: strtod() asking for ',' like decimal point???
- Date: Mon, 3 Apr 2006 09:21:31 -0300 (ART)
Hello!
I'm in Brazil.
Look this code:
---- start
char *pChar;
g_print("Literal to Double value = %10,5g", strtod(
(const char*) "3.14151692", &pChar );
g_print("Literal to Double value = %10,5g", strtod(
(const char*) "3,14151692", &pChar );
---- end
on console I had:
3,00000
3,14152
My Operating System (Linux/Windows) is configured to
use ',' (comma) like decimal point.
I don't know how to inform strtod() to ignorate the
locale of Operating System and convert using '.' like
decimal point.
I'm using g++ on Linux and Dev-C++ on Windows.
Thanks.
(o_o)
Marcelo David
_______________________________________________________
Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora!
http://br.mobile.yahoo.com/mailalertas/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]