tags:

views:

46

answers:

1

Hey,

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 space?

Thanks,

Stefanie

+4  A: 

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).

Thomas
OMG, thanks. Never thought it could be that easy...
Stefanie
@Stefenie: The customary way to thank somebody for a correct answer on stackoverflow is to mark that answer as accepted.
Johnsyweb