hi,
I have a structure like the following that I'm trying to assign characters to and send across the network.
Code:
struct my_data {
__be32 name; // this is a 4 byte field
unsigned char version:8;
};
I was trying to assign the letters a, b, c, and d using bit shifting to these fields but don't beleive I have this correct. Can anyone help out here?
Code:
struct my_data *dat;
// alloc data struct here ...
dat->letA = (0x61 << 0);
dat->letB = (0x62 << 0);
dat->letC = (0x63 << 0);
dat->letD = (0x64 << 0);
dat->version = 0x01;