T
Terence
Help Need!!!
I am writing a program for a distributed system course.
I need to marshall all the messages in order to send them thru a socket.
The first 8 bytes of the message are used to store the length of the message,
and then the rest are the actual content of the message.
So I have a big char array, what is the easiest way to store an 8-byte integer
across the first 8 characters in the array?
For Examples:
Integer 1:
00 00 00 00 00 00 00 01 ...
Integer 10:
00 00 00 00 00 00 00 0A ...
Integer 256:
00 00 00 00 00 00 01 00 ...
I don't want to calculate each of the byte
How do I put the integer in this array??
Thanks,
Terence
I am writing a program for a distributed system course.
I need to marshall all the messages in order to send them thru a socket.
The first 8 bytes of the message are used to store the length of the message,
and then the rest are the actual content of the message.
So I have a big char array, what is the easiest way to store an 8-byte integer
across the first 8 characters in the array?
For Examples:
Integer 1:
00 00 00 00 00 00 00 01 ...
Integer 10:
00 00 00 00 00 00 00 0A ...
Integer 256:
00 00 00 00 00 00 01 00 ...
I don't want to calculate each of the byte
How do I put the integer in this array??
Thanks,
Terence