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.

```
You have to use [bitwise operators](http://msdn.microsoft.com/en-us/library/17zwb64t(VS.80).aspx). 

Here's an example:

```
int firstBit = 0x1;
int secondBit = 0x2;
int thirdBit = 0x4;
int fourthBit = 0x8;

int x = firstBit | fourthBit; /*both the 1st and 4th bit are set */
int isFirstBitSet = x & firstBit; /* Check if at least the first bit is set */

```