I want to create an array that contains elements of a structure, each element of the struct is a boolean and when accessing each array element I want to modify the value of the structure. Structure is a global variable, when modifying the array element, I want to also modify the global structure.
typedef struct
{
bool bool1;
bool bool2;
bool bool2;
} struct_bool;
struct_bool my_struct;
bool array_dummy[3] = {my_struct.bool1, my_struct.bool2, my_struct.bool3};
array_dummy[0] = true;
array_dummy[1] = true;
array_dummy[2] = false;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…