Expression must be integral or unscoped enum type?

4043 views c++
-2

Here is my code:

CString fontroute = me32.szExePath + L"Exo-Regular.ttf";

and for some reason vs2017 highlights the L and says "Expression must be integral or unscoped enum type"

answered question

1 Answer

8

me32.szExePath is of type char*. You cannot add (+) a wchar_t-Array (L"foobar") to it.

Construct a temporary CString from me32.szExePath:

CString fontroute = CString{ me32.szExePath } + L"Exo-Regular.ttf";

and it should work.

posted this

Have an answer?

JD

Please login first before posting an answer.