R
.rhavin grobert
this is m$ vc++, but the question itself is c++ specific...
TCHAR is a 'char' in non-unicode.
functions return...
TCHAR* CString::GetBuffer(int);
int CString::GetLenght(int);
__________________________________________
// code:
CString str ="SomeStringWithMoreThanOneTChar";
TCHAR *(pEnd[2]) = /* § */ str.GetBuffer(str.GetLength()) +
str.GetLength() - 2;
// in other words: a pointer to the second-last TCHAR is returned
__________________________________________
in the place marked "/* § */", a cast is neccesary. My problem: i dont
find the correct syntax.
the error given is "cannot convert from 'char *' to 'char *[2]' ", but
inserting
(char *[2]), (char (*[2])), ((char*) [2]) or (*(char[2])) doesnt work.
Anyone knows the correct syntax for a cast to a pointer-to-two-
adjactend-TCHARs please?
TCHAR is a 'char' in non-unicode.
functions return...
TCHAR* CString::GetBuffer(int);
int CString::GetLenght(int);
__________________________________________
// code:
CString str ="SomeStringWithMoreThanOneTChar";
TCHAR *(pEnd[2]) = /* § */ str.GetBuffer(str.GetLength()) +
str.GetLength() - 2;
// in other words: a pointer to the second-last TCHAR is returned
__________________________________________
in the place marked "/* § */", a cast is neccesary. My problem: i dont
find the correct syntax.
the error given is "cannot convert from 'char *' to 'char *[2]' ", but
inserting
(char *[2]), (char (*[2])), ((char*) [2]) or (*(char[2])) doesnt work.
Anyone knows the correct syntax for a cast to a pointer-to-two-
adjactend-TCHARs please?