This question already has an answer here:
- Convert MFC CString to integer 10 answers
I am trying to convert CString
to int and float but unable to find any C++ library function to get this done. please help.
This question already has an answer here:
I am trying to convert CString
to int and float but unable to find any C++ library function to get this done. please help.
The proper UNICODE-compliant way of doing it in MFC is the following:
As David Heffernan mentioned: If your project configuration is UNICODE only and you don't use MBCS and do not have any plans to target old MS OSs like Window 98 you can use:
In C++11 you can use the following: