[ create a new paste ] login | about

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

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

int main()
{
  uint8_t bla = 33; // = 0b00100001;

  uint8_t i = 8;
  while ( i-- > 0 )
    printf("%d\n", bitRead( bla, i ));
}


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


Create a new paste based on this one


Comments: