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).
精彩评论