I got this code here to print the binary of a decimal, if I ran this function with argument as 3, it would print 0000 0011, which is right, I understand that >> will shift the binary to the right 7 to 0 to display the binary, but I do not understand the purpose of the code: & 1 and + 0, can someone tell me what are those for?
void gal_print(gal8 a)
{
int i = 8;
while (i--)
// printf("%d", i);
putchar((a >> i & 1) + '0');
}