Embedded System Question:

How to define a structure with bit field members?

Tweet Share WhatsApp

Answer:

You can define structure bit field members with Dot operators.

EXAMPLE:

#include <stdio.h>
int main()
{

Struct bit_field
{
Int x.4; // it allocates only 4 bits to x
Char C.6; // it allocates only 6 bits to C;
};

return 0;
}

Download Embedded System PDF Read All 21 Embedded System Questions
Previous QuestionNext Question
Explain What is the difference between embedded systems and the system in which RTOS is running?Explain What is interrupt latency?