Convert MFC CString to integer

后端 未结 11 2122
南旧
南旧 2020-12-08 13:15

How to convert a CString object to integer in MFC.

11条回答
  •  星月不相逢
    2020-12-08 13:52

    The problem with the accepted answer is that it cannot signal failure. There's strtol (STRing TO Long) which can. It's part of a larger family: wcstol (Wide Character String TO Long, e.g. Unicode), strtoull (TO Unsigned Long Long, 64bits+), wcstoull, strtof (TO Float) and wcstof.

提交回复
热议问题