We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I want to use a structure as given below on my ARM Cortex-M0, I am using C programming.
struct path_table_t {
uint8_t lut_index;
uint8_t flag : 1; };
'flag' field is made to be single bit by bit fields.How will be the memory allocation for the array of above mentioned structure will happen.
Will I get the benefit of bit fields as saving in total memory
How will be the memory allocation for the array of above mentioned structure will happen.
Ignore the bitfield specifier and just read the structure - you'll get two uint8_t types allocated in memory.
No - it's just a more convenient syntax than manually performing AND and OR mask operations - but there is no "magic" here.
HTH, Pete