如何unsigned char* 转换成 PUCHAR (unsigned char*)"\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf"如何转换成PUCHAR? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 windef.h中:typedef unsigned char UCHAR;typedef UCHAR *PUCHAR;所以,根本就不用转换。 PUCHAR就是unsigned char*,两者等价。 我要用到一个函数原型是这样的WriteReserveArea(PUCHAR DataBuffer, UINT Offset, UINT Sectors);但为什么当直接我把"\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf"放入到DataBuffer时会出现这样的错误?error C2664: 'WriteReserveArea' : cannot convert parameter 1 from 'char [17]' to 'unsigned char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 这和你的提问好像不是一码事儿吧。你这个直接强制转换就可以了,因为字符数组默认可以转换为char*但没有到unsigned char*的转换。 根据ip查看流量 使用shellexcute隐藏启动程序的闪屏! extern 的简单问题 API编程如何用使用位图按钮?谢谢 室友用的XP2500+的CPU,风扇太吵,向问一下换哪块风扇比较好 MFC单文档程序中用Postmessage发送滚动条消息发生错误 怎么监视一个文件夹中文件的变化呢? 高分请教一道考试题 ShowWindow的问题 vector<Bitmap * > 怎么把Bitmap 加到push_back里面的啊 VC基于对话框的下拉菜单如何实现? 老位老大知道如何装jpg格式图片转换成BMP格式
typedef unsigned char UCHAR;
typedef UCHAR *PUCHAR;所以,根本就不用转换。
WriteReserveArea(PUCHAR DataBuffer, UINT Offset, UINT Sectors);但为什么当直接我把"\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9\xa\xb\xc\xd\xe\xf"放入到DataBuffer时会出现这样的错误?
error C2664: 'WriteReserveArea' : cannot convert parameter 1 from 'char [17]' to 'unsigned char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast