2008년 01월 10일
How to convert from CString to std::string?
There are really many ways to do it.
But, the simplest one is just this -
Note that as discussed in this post, CStringA is a template specialization of class CStringT for type char avaÃlable with Visual Studio 7.x and better.
CString 을 string 으로 변환할 일이 있었는데 VS 6.0 에서는 먹히던 방법이 VS 2005 에서 안먹히길래 다른 방법을 찾아봤습니다.
구글링을 해보니 금새 나오는군요 ;)
But, the simplest one is just this -
CString strSomeCstring ("This is a CString Object");
// Use ANSI variant CStringA to convert to char*; construct from it -
std::string strStdString (CStringA (strSomeCstring));
Note that as discussed in this post, CStringA is a template specialization of class CStringT for type char avaÃlable with Visual Studio 7.x and better.
CString 을 string 으로 변환할 일이 있었는데 VS 6.0 에서는 먹히던 방법이 VS 2005 에서 안먹히길래 다른 방법을 찾아봤습니다.
구글링을 해보니 금새 나오는군요 ;)
이 글과 관련있는 글을 자동검색한 결과입니다 [?]
# by | 2008/01/10 15:55 | Develop | 트랙백 | 덧글(1)






☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]