I'm trying to send a BYTE* over a socket, but the send function only allows me to send a char* buffer. Is this possible? How would I go about casting it back on the other side?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Use reinterpret_cast
to cast from BYTE*
to char*
. A BYTE
is an unsigned char
typedef, so you shouldn't have any issues.
char* foo = reinterpret_cast<char*>(bar);
Where bar
is your BYTE*
.