wcscat (or strcat)
char *strcat( char *strDestination, const char *strSource );
wchar_t *wcscat( wchar_t *strDestination, const wchar_t *strSource );
Parameters
strDestination
Null-terminated destination string.
strSource
Null-terminated source string.
wcscat_s(or strcat_s)
errno_t strcat_s( char *strDestination, size_t numberOfElements, const char *strSource );
errno_t wcscat_s( char *strDestination, size_t numberOfElements, const char *strSource );
Parameters
strDestination
Null-terminated destination string buffer.
numberOfElements
Size of the destination string buffer. -> 즉 size만 들어가면 됨
strSource
Null-terminated source string buffer.
리턴값이 0이면 성공 아니면 에러값이 리턴됨
wcstok(or strtok)
char *strtok( char *strToken, const char *strDelimit );
wchar_t *wcstok( wchar_t *strToken, const wchar_t *strDelimit );
Parameters
strToken
String containing token(s).
strDelimit
Set of delimiter characters
리턴값: return a pointer to the next token found in strToken. 즉 토큰의 다음 위치
wcstok_s(or strtok_s)
char *strtok_s(char *strToken, const char *strDelimit, char **context);
char *wcstok_s(char *strToken, const char *strDelimit, char **context);
Parameters
strToken
String containing token or tokens.
strDelimit
Set of delimiter characters.
context
Used to store position information between calls to strtok_s
리턴값: wcstok과 동일함
context는 주로 TCHAR* ch로 선언 후 wcstok_s(token,delimit,&context);로 사용함
(MSDN에서 예제 소스 보면 loop안에서 항상 같은 방법으로 사용됨)
즉..
wcstok_s(token,delimit,&context);
while(condition){
...
wcstok_s(NULL, delimit, &context);
}
댓글