Re: Convert CString to int.
Quote:
I'm working with VC++ using Visual Studio.net 2008 platform
There is no such thing. Check the name again.
You call 25 a string?
You can also use atoi().
Re: Convert CString to int.
1. Use _T() macro and _t... versions of C-runtime functions to make your code both UNICODE and ANSI aware.
2. You can also use _ttol, _ttoi, _tcstol functions.
Re: Convert CString to int.
int ss;
CString ab="25";
sscanf((const char*)ab,"%d",&ss);
Re: Convert CString to int.
Version with generic text mappings, according to VictorN's note:
int ss;
CString ab=_T("25");
_stscanf((LPCTSTR)ab, _T("%d") ,&ss);