유용한 것들_func
CString <-> int , CString <-> double 변환
붕대마음
2009. 9. 4. 00:09
반응형
// CString -> int convert
CString strNum = _T("5");
int nNum = _ttoi(strNum);
// int -> CString convert
int nNum = 5;
CString strNum;
strNum.Format(_T("%d"), nNum);
// CString -> double
CString strNum = _T("5.5");
double nNum = _wtof(strNum);
vEye.z = (float)atof(strName);
// double -> CString
double nNum = 5.5;
CString strNum;
strNum.Format(_T("%f"), nNum);
// Multibyte 기반일 경우
// _ttoi -> atoi
// _wtof -> atof 로 바꿔주면 된다
CString strNum = _T("5");
int nNum = _ttoi(strNum);
// int -> CString convert
int nNum = 5;
CString strNum;
strNum.Format(_T("%d"), nNum);
// CString -> double
CString strNum = _T("5.5");
double nNum = _wtof(strNum);
vEye.z = (float)atof(strName);
// double -> CString
double nNum = 5.5;
CString strNum;
strNum.Format(_T("%f"), nNum);
// Multibyte 기반일 경우
// _ttoi -> atoi
// _wtof -> atof 로 바꿔주면 된다