Why does _tcstok return lower case?
Printable View
Why does _tcstok return lower case?
It highly depends on your input on what your output will be... So how do you call _tcstok()?
for example: the input string is "ROGER", the function returns: "roger".
So can please give a full code of how you call your _tcstok() function?Quote:
Originally Posted by MSDN
PTCHAR _getNextToken(void)
{
TCHAR theDelim[] = TEXT(" ");
TCHAR quotedDelim[] = TEXT("\"");
TCHAR *theToken = NULL;
theToken = _tcstok(NULL, theDelim);
if(theToken && theToken[0]==_T('"'))
{
theToken[_tcslen(theToken)] = _T(' ');
theToken++; // skip the leading "
_tcstok(NULL, quotedDelim); // Look for the trailing "
}
return theToken;
}
Oops, I found a call to: _tcslwr(Command) before _tcstok. Sorry!