I need some help in understanding the syntax of a Bitfield definition. I read the Microsoft documentation page on it but the example there still leaves me with my question. Given a Bitfield and main method like this:
struct {
unsigned short character : 8;
unsigned short color : 4;
} text[80];
int main() {
text[20].character = 'a';
text[20].color = 5;
}
For better reference of what I'm asking, here numbered:
- What do the
[80]
and the[20]
's mean here? - Does
text[80]
mean an array of 80 such structs? - Does
text[20].character = 'a'
mean, that at position 20 of the array there is a character'a'
?