How can I convert a CString, which has extracted the writing on a button (always a number in my app), into an ineteger that I can pass to a function taking integer values?
thanks
steve
Printable View
How can I convert a CString, which has extracted the writing on a button (always a number in my app), into an ineteger that I can pass to a function taking integer values?
thanks
steve
Hi, simply use atoi function.
CString str = "123";
int n = atoi(str); // CString is casted automatically to LPCTSTR by the CString operator LPCTSTR
Hi,
use operator LPCTSTR ()for converting CString object.Then use atoi(LPCTSTR).
Hope this helps you.
Manash