I have an array of 1's and 0's in C.
int foo[8];
int main()
{
int i = 0;
for (i; i < 8; i++)
{
foo[i] = 0;
}
foo[1] = 1;
foo[3] = 1;
}
So, my array now is something like this:
01010000
And I want to convert this bin
representation of my array to hex
number.
In this case it will be 0x50.
Is there any fast and easy way to do this?