Embedded System Question:
How to define a structure with bit field members?

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;
}
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;
}
Previous Question | Next Question |
Explain What is the difference between embedded systems and the system in which RTOS is running? | Explain What is interrupt latency? |