Does std::locale::global make affect to printf() function?

后端 未结 2 1027
北荒
北荒 2021-01-12 12:40

I\'m using Russian locale settings on my PC.
If I would set:

class numpunct_withpoint: public numpunct
{
protected:
    /// Override the fun         


        
2条回答
  •  悲哀的现实
    2021-01-12 13:12

    The C library does not use the same locale settings as C++. To override the locale used by printf, use setlocale:

    setlocale(LC_NUMERIC, "POSIX");
    

    or similar.

提交回复
热议问题