ultio
12-03-2003, 18:40
each message to/from the server is in the form of
<length><type><data>
where <length> and <type> are 2 bytes each. <length> specifies the length in
bytes of the <data> portion of the message. Be aware that <length> and <type>
appear to be in little-endian format (least significant byte goes first). For
example, in the C language you would encode the number 1 as
const unsigned char num[2] = { 0x01, 0x00 };
and 256 would be encoded as
const unsigned char num[2] = { 0x00, 0x01 };
:cry: :cry: :confused: :cry: :confused: :confused:
aiuto, come faccio in c++???
mi sembra di aver capito di dover usare l'operatore ^, ma non sono sicuro e del resto poi non so continuare...
non posso creare una costante per 256 mumeri, sarebbe un'idiozia :D
esiste una funzione che fa tutto da sola?
o un modo per crearla?
grazie ;)
PS: scusate l'oggetto un pò stupido, ma non ho trovato di meglio
<length><type><data>
where <length> and <type> are 2 bytes each. <length> specifies the length in
bytes of the <data> portion of the message. Be aware that <length> and <type>
appear to be in little-endian format (least significant byte goes first). For
example, in the C language you would encode the number 1 as
const unsigned char num[2] = { 0x01, 0x00 };
and 256 would be encoded as
const unsigned char num[2] = { 0x00, 0x01 };
:cry: :cry: :confused: :cry: :confused: :confused:
aiuto, come faccio in c++???
mi sembra di aver capito di dover usare l'operatore ^, ma non sono sicuro e del resto poi non so continuare...
non posso creare una costante per 256 mumeri, sarebbe un'idiozia :D
esiste una funzione che fa tutto da sola?
o un modo per crearla?
grazie ;)
PS: scusate l'oggetto un pò stupido, ma non ho trovato di meglio