if you plan to make bit flags to find out if a certain bit is selected, declare an array of bit flags in your header file.
Code:
int bitFlag[8]={1,2,4,8,16,32,64,128};
That will enable you to get a bit status from a single byte variable. for use with shorts and longs, just extend the array to compensate. heres a function that i include in all my programs.
Code:
int GetBit(BYTE byte,int bit)
{
if ( (bit<0)||(bit>7) )
{
Notify(NULL,"bit request error; \nmust be between 0 and 7");
exit(ERR_GETBIT);
}
if (byte&bitFlag[bit])
return 1;
return 0;
}
dont steal my code, but learn from it if you need to. i doubt you'll need to, im probably not even talking about the same problem as you.