[ create a new paste ] login | about

Link: http://codepad.org/jtApX9tP    [ raw code | output | fork ]

C++, pasted on Dec 12:
1
2
3
4
5
6
7
8
9
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)

int main()
{
  uint8_t bla = 217; // = 0b11011001;

  for (uint8_t i = 0; i < 8; i++)
    printf("%d\n", bitRead( bla, i ));
}


Output:
1
2
3
4
5
6
7
8
1
0
0
1
1
0
1
1


Create a new paste based on this one


Comments: