0
当建立我的C++应用程序的构建在这行代码C++如何在函数调用中将char *转换为unsigned char *?
if (!PyTuple_GetByte(poArgs, 0, &SourceCell.window_type))
与此错误
错误C2664失败: 'PyTuple_GetByte':不能转换参数3从 '字符*' 到'无符号字符*”
这是被调用的函数:
bool PyTuple_GetByte(PyObject* poArgs, int pos, unsigned char* ret);
第三个参数&SourceCell.window_type
是char
类型。
有没有办法转换/施放该参数的函数调用里面像
if (!PyTuple_GetByte(poArgs, 0, reinterpret_cast<unsigned char*>(&SourceCell.window_type)))
还是我必须用另一种方式来处理呢?
试试看..... – knivil
一个'static_cast'应该正常工作IIRC。 –
'if(!PyTuple_GetByte(poArgs,0,reinterpret_cast(&SourceCell.window_type)))'不起作用吗? –
NathanOliver