Most efficient way of creating a bool array in C - AVR
Bit fields don't work like that. Cventu's answer shows a correct way to use them, but in this case, I recommend avoiding them altogether.

Instead, create an array of 8-bit values and use shifting and masking to access it:

uint8_t flags[16];

//Initialize the flags
void init_flags(void)
{
    for (i = 0; i &lt; 16; i++)
    {
        flags[i] = 0x00;
    }
}

//Set one flag based on the address
void set_flag(uint8_t address)
{
    flags[address/8] |= 0x1 &lt;&lt; (address % 8);
}

//Clear one flag based on the address
void clear_flag(uint8_t address)
{
    flags[address/8] &amp;= ~(0x1 &lt;&lt; (address % 8));
}

//Check whether a flag is set
bool get_flag_state(uint8_t address)
{
    return (flags[address/8] &amp; (0x1 &lt;&lt; (address % 0x8))) != 0x00;
}


This is probably what the compiler will do with bit field accesses anyway, and it's easier to work with. Some optimizers are bad at optimizing bit fields, so the compiler might even do worse. All compilers I've seen turn division and modulus by a constant power of two into right-shift and AND instructions. You can use those operations directly if you're feeling paranoid:

flags[address&gt;&gt;3] |= 0x1 &lt;&lt; (address &amp; 0x7);


Bit fields are more like structures than arrays. In my experience, they're only useful for things that have names, like register fields.