[英]Expression must be integral or unscoped enum type in C++?
Here is my code: 这是我的代码:
CString fontroute = me32.szExePath + L"Exo-Regular.ttf";
and for some reason Visual Studio 2017 highlights the L
and says "Expression must be integral or unscoped enum type"
. 出于某种原因,Visual Studio 2017突出显示了L
并说"Expression must be integral or unscoped enum type"
。
me32.szExePath
is of type char*
. me32.szExePath
的类型为char*
。 You cannot add ( +
) a wchar_t
-Array ( L"foobar"
) to it. 您不能在其中添加( +
) wchar_t
-Array( L"foobar"
)。
Construct a temporary CString
from me32.szExePath
: 从me32.szExePath
构造一个临时CString
:
CString fontroute = CString{ me32.szExePath } + L"Exo-Regular.ttf";
and it should work. 它应该工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.