有一个BYTE类型(unsigned char)的数组,BYTE array[100]
直接调用send(socket,array,100,0),在vc++ 6下编译器报错:
error C2664: 'send' : cannot convert parameter 2 from 'const unsigned char *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast改为
send(socket,(char*)array,100,0);强制转换一下就不报错了,
但是有个问题,char范围是-128到127,unsigned char的范围0到255,会不会因为舍弃符号位出现问题?