I have some information that i need to store. 12 x 4 bits. It is a application where every bit counts so i want to store the information in 6 bytes. But now my question, Is it possible to make an array containing 12x4 bits, so the information is easy accessible?
You can't create an array of n bits, only 8 bits (1 byte) because most machines cannot address a bit directly. On most machines, bits don't have an address. Since a nybble is half a byte (usually 4 bits), it's too small to be granted an address. Therefore, it cannot be an array.
What you'll have to do is use 1 byte to store 2 nybbles. This is achieved either by manually accessing each individually bit (tedious), or use bit-masking. For example: