How to access all structure elements in C. Means I want to take all the data of variables in the structure.
struct data { char a:1; char b:2; char c:3; char d:1; } arr;
I can access individual members using. operator. But I need to get access to all members of this structure. Please tell us how to do this.
As proposed to make the union of all data and the structure of the bit field.
union { char Whole; struct data { char a:1; char b:2; char c:3; char d:1; } arr; } MyData;