I am doing a socket program and, after my server is connected with the device, I am trying to send a message to him. But the send() function returns a number of bytes greater th
Assuming you've got
TYPE* myPointer;
then sizeof(myPointer)
will give you the size of the pointer (i.e. 4 bytes on a 32 bit system, 8 on a 64 bit system), not the size of the array.
You want to do
const int bufferSize = 7;
HEX_bufferMessage = new CHAR[bufferSize];
...
retorno = send(sckSloMo, HEX_bufferMessage, sizeof(CHAR) * bufferSize, 0);