Simple question:
How do i tell which bits in the byte are set to 0 and which are set to 1
for example:
//That code would obviously wont work, but how do i make something similar that would work?
byte myByte = 0X32;
foreach(bool bit in myByte)
{
Console.WriteLine(bit);
}
//Part 2 revert
bool[] bits = new bool[8];
bits[0] = 0
bits[1] = 0
bits[2] = 0
bits[3] = 0
bits[4] = 0
bits[5] = 1
bits[6] = 0
bits[7] = 0
byte newByte = (byte)bits;
The entier internet is full of examples, but i just cant figure out