G
gw7rib
I'm using a system in which TCHAR is typedef-ed to represent a
character, in this case a wchar_t to hold Unicode characters, and
LPCTSTR is typedef-ed to be a pointer to constant wchar_t. I presume
it's supposed to be a pointer to constant TCHAR, though they seem to
be defined in parallel rather than one typedef using the other.
I'm perfectly happy using LPCTSTR for a constant string, but for some
reason it seems odd to use LPCTSTR as an actual pointer. For instance,
in the following snippet:
for(ptr = str; *ptr; ptr++)
I am happy for str to be a LPCTSTR, but ptr feels like it should be a
const TCHAR*. Even though they are of course the same type.
Am I just weird?
Paul.
character, in this case a wchar_t to hold Unicode characters, and
LPCTSTR is typedef-ed to be a pointer to constant wchar_t. I presume
it's supposed to be a pointer to constant TCHAR, though they seem to
be defined in parallel rather than one typedef using the other.
I'm perfectly happy using LPCTSTR for a constant string, but for some
reason it seems odd to use LPCTSTR as an actual pointer. For instance,
in the following snippet:
for(ptr = str; *ptr; ptr++)
I am happy for str to be a LPCTSTR, but ptr feels like it should be a
const TCHAR*. Even though they are of course the same type.
Am I just weird?
Paul.