What I need to do is convert a binary number into a integer when the binary number is stored as a int array? The binary number must be in an array.

Printable View

- 04-05-2011darres90Convert Binary Number into Integer
What I need to do is convert a binary number into a integer when the binary number is stored as a int array? The binary number must be in an array.

- 04-14-2011texus
If Bin is the binary number that is stored as an array of integers:

Code:`int Bin[] = { 1, 1, 0, 1 };`

int Integer = Bin[3] + 2*Bin[2] + 4*Bin[1] + 8*Bin[0];