putting a numeric value into an array of chars?
hi, i'm sending a socket message with the format
but this doesnt seem to work with the size, as at the other end it always comes out as a different value.
char comm // command. 1 byte
ushort size // size of following data. 2 bytes
char data[size] // miscellaneous data. size bytes
// i try to put it into a buffer like this.
char *buf = new char[size+3];
buf = comm;
buf = (char)size;
buf = (char)size+1;
send(s, buf, size+3, 0);
anyone know how to do this?