Expression must be integral or unscoped enum type?

4043 views c++

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


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?


Please login first before posting an answer.