Question: I have an array with 16 elements. I would like to evaluate these to a boolean 0 or 1 and then store this in 2 bytes so i can write to a binary file. How do I do this?

Answer: 
Something like this you mean?

```
unsigned short binary = 0, i;
for ( i = 0; i < 16; ++i )
  if ( array[i] )
    binary |= 1 << i; 

// the i-th bit of binary is 1 if array[i] is true and 0 otherwise.

```
```
int values[16];
int i;
unsigned short word = 0;
unsigned short bit = 1;

for (i = 0; i < 16; i++)
{
    if (values[i])
    {
        word |= bit;
    }

    bit <<= 1;
}

```