Hello maybe it is a neubie question but i have problems reading the real values coming from a binary BE archive in a LE machine (Intel based).
One of the structures to read is:

struct s{ //60 bytes
char a[6];
char b[6];
char c[6];
char d[6];
char e[6];
char f[6];
char g[4];
struct X x_;
struct X xr_;
char h[10];
}s_;

i use to obtain the original values:

a= (((uint64_t)(s_.s.a[0]) << 56
| (uint64_t)(s_.s.a[1]) << 48
| (uint64_t)(s_.s.a[2]) << 40
| (uint64_t)(s_.s.a[3]) << 32
| (uint64_t)(s_.s.a[4]) << 24
| (uint64_t)(s_.s.a[5]) << 16) >> 16);

i use this for all the fields, is that correct? if not, what kind of displacement i must use or where i can find good info about that topic?
Thank you