Search Results for 'cstring'

ATOM Icon

1 POSTS

  1. 2008/11/27 형변환 by shiftkey

형변환

Unicode 시대

Unicode 시대로 가기가 힘들다


MBCS에서 UNICODE로 가기위해서 Type Casting 해야될 것이 많다.
그래서 일이 있을 때마다 여기에 정리해본다.


유니코드와는 관계없이 형변환 방법을 정리

CSting to TCHAR


CString strTest(_T("가나다ABC아라요"));
TCHAR cTest[255];
swprintf(cTest,strTest.GetBuffer(strTest.GetLength()));


CSting to char*


CString strTest;
char *cTest;
cTest=strTest.GetBuffer(strTest.GetLength());


CSting to int


int CString2Int(CString str)
{
int val= 0;
int tmp = 0;
while (str.GetLength()) {
if (!isdigit(str[0])) return -1;
tmp =str[0] - '0';
val= val* 10 + tmp ;
str= str.Right(str.GetLength()-1);
}
return val;
}

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by shiftkey

2008/11/27 08:43 2008/11/27 08:43
, , , , ,
Response
No Trackback , No Comment
RSS :
http://shiftkey.org/rss/response/177

« Previous : 1 : Next »

블로그 이미지

Shiftkey가 살아가는 이런 저런 이야기......

- shiftkey

Tag Cloud

Notices

Archives

Categories

Authors

  1. shiftkey

Calendar

«   2012/05   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Site Stats

Total hits:
161240
Today:
21
Yesterday:
243
Subscribe to RSS articles Subscribe to RSS responses Subscribe to ATOM articles Subscribe to ATOM responses