samyee
asked on
CString & Number Conversions
Hi
Any good way to convert number (e.g. UINT, int etc) to CString & vice-versa..... Right now, my method is
===================
int i = 30;
CString cStr;
char str[10];
sprintf(str,"%d",i);
cStr = str;
============
Which I find is not good becos I need to use a char array....
Any good way to convert number (e.g. UINT, int etc) to CString & vice-versa..... Right now, my method is
===================
int i = 30;
CString cStr;
char str[10];
sprintf(str,"%d",i);
cStr = str;
============
Which I find is not good becos I need to use a char array....
Just use CString.Format( ...)
CString -> int:
cStr.Format("%d",i);
int -> CString:
int i = atoi(cStr);
cStr.Format("%d",i);
int -> CString:
int i = atoi(cStr);
sorry, just swap the arrows <-
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.