this is m$ vc++, but the question itself is c++ specific...
TCHAR is a 'char' in non-unicode.
functions return...
TCHAR* CString::GetBuf fer(int);
int CString::GetLen ght(int);
_______________ _______________ ____________
// code:
CString str ="SomeStringWit hMoreThanOneTCh ar";
TCHAR *(pEnd[2]) = /* § */ str.GetBuffer(s tr.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::GetBuf fer(int);
int CString::GetLen ght(int);
_______________ _______________ ____________
// code:
CString str ="SomeStringWit hMoreThanOneTCh ar";
TCHAR *(pEnd[2]) = /* § */ str.GetBuffer(s tr.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?
Comment