1. ## Bytes

I have a 4 BYTE array, where a BYTE is an unsigned Char. The last byte is non-effective and so is array bit [7]. They have been set to 1 and can be discarded.

Does anybody have an idea on how to get all possible values for the remaining 22 bits...keeping the 32bit structure in tact as a function expects the full 32bits.

Thank you!!!!

2. ?

To find the max value of a number of bits - set all the bits to 1. What are you trying to do?

3. I'm shooting in the dark here, but you know that a long is four bytes right? Why don't you just make these calculations using longs instead of four byte arrays.

4. ## Re: Bytes

Originally posted by Unregistered
I have a 4 BYTE array, where a BYTE is an unsigned Char. The last byte is non-effective and so is array bit [7]. They have been set to 1 and can be discarded.

Does anybody have an idea on how to get all possible values for the remaining 22 bits...keeping the 32bit structure in tact as a function expects the full 32bits.

Thank you!!!!
A bit has only 2 possible values
0 or 1 !!!!
Can you be more specific in your question. I understand that the last byte is not needed, but that would leave 24 bits, not 22.
Did you make a typo somewhere?

5. You have 4 bytes = 32 bits. As I understand the last byte and bit nr 7 can be discarded so 32 - 8 - 1 = 23 bits left. The maximum value you can get now is 2^23-1 = 8388607.

Is this what you mean?