Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Two values in one variable

Name: Anonymous 2010-01-16 18:52

Let's say you have two small values that will never get past 10, and you use the first four bits of a char for the first var and the last bits for the second var. Do people do that?

Name: Anonymous 2010-01-17 14:19

>>6
alignment/padding constraints
If I understand correctly, this makes a struct like
struct s {
    char a, b;
    int z;
};

be represented on a 32-bit system as
[ a :8 ][ b :8 ][ padding : 16 ][             z:32             ]
?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List