tim24
July 8th, 2009, 10:04 PM
Hi all,
I got 2 programs running on 2 different machines.
program A set some configs to buffer and sends the buffer to program B. B read the buffer and display the config.
A and B both cast the buffer to a structure and then access structure's fields.
char buffer[128];
struct xx
{
int32 i;
int32 j;
char str[64];
}
For example:
xx *ptr= (xx*)bufffer;
xx->i = 1000;
xx->j= 6742;
So far I don't have problem because both machines running on PPC (big endian).
Now if A has also to be run on an Intel (little endian), what should I do to take care of this?
thanks in advance.
I got 2 programs running on 2 different machines.
program A set some configs to buffer and sends the buffer to program B. B read the buffer and display the config.
A and B both cast the buffer to a structure and then access structure's fields.
char buffer[128];
struct xx
{
int32 i;
int32 j;
char str[64];
}
For example:
xx *ptr= (xx*)bufffer;
xx->i = 1000;
xx->j= 6742;
So far I don't have problem because both machines running on PPC (big endian).
Now if A has also to be run on an Intel (little endian), what should I do to take care of this?
thanks in advance.