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.
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.
If Bin is the binary number that is stored as an array of integers:
Of cource the array must be bigger when the number it contains is bigger than 15.Code:int Bin[] = { 1, 1, 0, 1 }; int Integer = Bin[3] + 2*Bin[2] + 4*Bin[1] + 8*Bin[0];
Last edited by texus; 04-14-2011 at 11:19 AM.