본문 바로가기
프로그래머의 길/C & C++

CStringT::Tokenize.

by 제이콥케이 2009. 12. 2.
반응형

The following example demonstrates the use of CStringT::Tokenize.

//typedef CStringT< TCHAR, StrTraitATL< TCHAR > > CAtlString;
CAtlString str( "%First Second#Third" );
CAtlString resToken;
int curPos= 0;

resToken= str.Tokenize("% #",curPos);
while (resToken != "")
{
   printf("Resulting token: %s\n", resToken);
   resToken= str.Tokenize("% #",curPos);
};

Output

Resulting Token: First
Resulting Token: Second
Resulting Token: Third
반응형