Locale-independent “atof”?

后端 未结 8 1855
余生分开走
余生分开走 2020-12-14 17:21

I\'m parsing GPS status entries in fixed NMEA sentences, where fraction part of geographical minutes comes always after period. However, on systems where locale defines comm

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 18:13

    Do you really need to get locale behavior for numerics? If not

    setlocale(LC_ALL|~LC_NUMERIC, "");
    

    or the equivalent use of std::locale constructor.

提交回复
热议问题