[MFC] CString ↔ string 변환 CString → std::string USES_CONVERSION; // ATL Conversion 함수 사용 CString cstr = L"CString"; std::string str = std::string(CT2CA(cstr)); std::string → CString std::string str = "String"; CString cstr = str.c_str(); // string을 char 형으로 내보냄 코드/MFC 2021.04.26
[C++] Char의 형 변환 // Char array to integer char MyArray[20]; int nValue; nValue = atoi(MyArray); // Char array to float char MyArray[20]; float fValue; fValue = atof(MyArray); // Char Pointer to double char *str = " -343.23 "; double dVal; dVal = atof( str ); // Char Pointer to integer char *str = " -343.23 "; int iVal; iVal = atoi( str ); // Char Pointer to long char *str = "99999"; long lVal; lVal = atol( str ).. 코드/C++ 2021.04.20