我的指针有一些问题
void getPartOfString(const TCHAR * wholeString)
{
const TCHAR * pPointer = NULL;
pPointer = _tcsstr(wholeString, searchedString); //searching for a special string in string
pPointer += _tcslen(searchedString); //set pointer to the beginning of the string wanted
//here I want to check if the char, the pointer points to is a space and if it is set it forward
}
那么,我怎么能摆脱这个空间呢?
答案 0 :(得分:5)
如果我正确理解了这个问题:
if (*pPointer == _T(' '))
++pPointer;
_T
宏确保结果始终为TCHAR
类型,TCHAR
定义为char
(ANSI)或wchar_t
(Unicode )。