how can I convert a string (say:CString strNumber = '12';) into an integer (int nNumber = 12;)
Printable View
how can I convert a string (say:CString strNumber = '12';) into an integer (int nNumber = 12;)
call normal sscanf function giving CString as a first input parameter
or maybe better _stscanf
Try int nNumber = atoi(strNumber.GetBuffer(0));
Use nNumber = atoi(strNumber);
It will convert string to Integer.
Use itoa(nNumber,chrNumber,10);
strNumber = chrNumber;
It will convert Number to string.
where chrNumber is an array like
char chrNumber[10];