you must write a function which will use Decimal To Binary math. read about it here
http://www.wikihow.com/Convert-from-Decimal-to-Binary
then send each element into this function, and this function will generate binary code for your data, then manipulate that data add substract do anything you wish.
or.... check this
http://www.daniweb.com/software-development/cpp/threads/5270 it says:
int main()
{
char x = 'a';
int y;
// the value of 'a' in hex is 0x61, or 97 decimal
// in binary, that would be: 0 1 1 0 0 0 0 1
// or 64 + 32 + 1, or 2^7 + 2^6 + 2^0
//
//loop for number of bits in a character
//this will print out bits in reverse order
//least significant bit first
for(y = 0; y < sizeof(char) * 8; y++)
printf("%c ", ( x & (1 << y) ) ? '1' : '0' );
puts("");
return 0;
}
kinda works for me... (code is not mine).