티스토리 뷰
어디까지나 MFC 에서만 사용이 가능하다.
Java의 split 와 비슷한 개념으로 한번 만들어 봤다.
int splitString(CString str, CString var, CStringArray &strs)
{
int count = 0;
CString tempStr = str;
int length = str.GetLength();
while(length)
{
int find = tempStr.Find(var);
if(find != -1)
{
CString temp = tempStr.Left(find);
strs.Add(temp);
temp += var;
tempStr.Replace(temp, _T(""));
count++;
}
else
{
strs.Add(tempStr);
length = 0;
}
}
return count;
}
------------------------------------
실행 소스
CString temp = _T("park,,se,,chul");
CStringArray str;
int count = splitString(temp, _T(",,"), str);
if(count)
{
for(int i = 0 ; i < count ; i++)
?{
::AfxMessageBox(str.GetAt(i));
}
}
-------------------------------
쓰다 보니 온갖 꽁수를;;;; 소스 정리는 각자 알아서 하는 걸로;;;;;
※ 참고로 개발 환경은 Visual Studio 2008 버전
'Application > C/C++' 카테고리의 다른 글
QT 제목 표시줄 없애기 (0) | 2013.07.03 |
---|---|
itoa - Integer TO AscII (0) | 2013.06.11 |
[강좌] 블럭쌓기 만들기 13일차 (0) | 2012.06.17 |
[강좌] 블럭쌓기 만들기 12일차 (0) | 2012.06.17 |
[강좌] 블럭쌓기 만들기 11일차 (0) | 2012.03.26 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 3D Engine
- medical
- network
- Web Programming
- 막장로그
- 짤방 및 아이콘
- 프리랜서로 살아남는 법
- Life News
- diary
- humor
- cartoon
- Battle
- Information Processor
- Embedded System
- Military
- BadCode
- console
- win32
- WDB
- 나비효과
- Mabinogi
- C#
- Reverse Engineering
- Tech News
- Linux
- Assembly
- Network Inspector
- wallpaper
- USB Lecture
- 야마꼬툰
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함