Link to home
Start Free TrialLog in
Avatar of samyee
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....




Avatar of Andy_Keys
Andy_Keys

Just use CString.Format( ...)
CString -> int:
   cStr.Format("%d",i);

int -> CString:
   int i = atoi(cStr);

sorry, just swap the arrows <-
ASKER CERTIFIED SOLUTION
Avatar of visualc
visualc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial