how to convert BYTE array to char array for send w

2019-04-02 12:21发布

问题:

I have some problem. I write client server app where information send & receive with win socket. On my project need send BYTE array to client, and on client this char array convert to BYTE, how I can create it, please help me, because send() function can send only char*. Thank you.

WSAAPI
send(
    __in SOCKET s,
    __in_bcount(len) const char FAR * buf,
    __in int len,
    __in int flags
    );

回答1:

BYTE b[40];
const char *p = reinterpret_cast<const char*>(b);


标签: c++ byte winsock