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 0:49

#define GET_BIT(var,n) (var &= 1<<n)
#define SET_BIT(var,n) (var |= 1<<n)
#define CLEAR_BIT(var,n) (var &= ~(1<<n))

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