现在我正在开发NVAPI。
有一个类型是"NvAPI_UnicodeString“。
它是一个无符号短数组。
typedef NvU16 NvAPI_UnicodeString[NVAPI_UNICODE_STRING_MAX];
typedef unsigned short NvU16;还有一种类型"NvAPI_LPCWSTR“。
typedef const NvU16 *NvAPI_LPCWSTR;我想给NvAPI_UnicodeString赋值,如下所示
NvAPI_UnicodeString = L"Hello";但它不起作用。
请告诉我如何解决这个问题。
谢谢。
发布于 2014-04-11 00:33:58
不能使用=运算符为数组赋值。您必须使用memcpy或memcpy_s
NvAPI_UnicodeString wsz;
memcpy_s(wsz, sizeof(wsz), L"Hello", 6*sizeof(wchar_t));https://stackoverflow.com/questions/15942175
复制相似问题