How do I convert a CString to a double in C++?

后端 未结 4 856
被撕碎了的回忆
被撕碎了的回忆 2021-02-07 12:39

How do I convert a CString to a double in C++?

Unicode support would be nice also.

Thanks!

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 13:34

    You can convert anything to anything using a std::stringstream. The only requirement is that the operators >> and << be implemented. Stringstreams can be found in the header file.

    std::stringstream converter;
    converter << myString;
    converter >> myDouble;
    

提交回复
热议问题