开发者

How to get the Char a const * TCHAR pointer points to

I've got some problems with a pointer

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
}

So, how can I get rid of that s开发者_如何学编程pace?


If I understood the question correctly:

if (*pPointer == _T(' '))
    ++pPointer;

The _T macro ensures that the result is always of type TCHAR, whether TCHAR is defined as char (ANSI) or as wchar_t (Unicode).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜