Why is this a binary operation?
wxString Dir = _T("X:\\") + _T("Foldername");
error: invalid operands of types 'const wchar_t [4]' and 'const wchar_t [9]' to binary 'operator+'
And why do these proper string concats not ptoduce the same error?
wxString name = _T("Foldername");
wxString Dir = _T("H:\\") + name;
wxString Dir = file.GetPath() + _T("Foldername");
In general this is not a general programming forum. This is a codeblocks forum, so this is the wrong place for this question.
Disclaimer, this is more pseudo code than actual code:
In your case i think _T defines to something like this
or something like this
what translates to
#define _TCHAR(n) wchar_t(n)
so your final line of code is
wxString Dir ={'X', ':' + '\\'} + {'F','o','l','d','e','r','n','a','m','e'};
what is like
wxString Dir = char[4] + char[11];
and adding arrays is not defined...
what is a binary operation, normally
Ah, I was wondering why there were [n] brackets but it didn't sink in.
It's actually:
#define _T(x) __T(x)
Solved it with:
wxString Dir.append(_T("X:\\"), _T("Foldername"));
Edit: Spoke too soon. The compiler didn't complain but appending two stings this way crash CB when executed. I had to use an assign and then append the next.
An intermediate variable also did the trick.
Thanks, and I will NEVER ask for help in the Help forum again. What w.a.s I thinking... ;D