I'm trying to initialize a char array which is part of a structure as follows:
#define TRUE 1
#define FALSE 0
struct s_field_def { // structure for managing display field
char f_txt[16]; // option text
bool f_inhibit; // set this to inhibit updating of the field on the display
};
enum field_name {F_STATE, F_PULSE};
void setup() {
// initialize display fields structure
struct s_field_def fields[2]; // initialize the display fields
fields[F_STATE] = {"HALTED", FALSE}; // displays the current run state
fields[F_PULSE] = {"@", TRUE}; // displays indicator of system running
}
void loop() {
}
The initialization of the structure is producing an error at these lines:
fields[F_STATE] = {"HALTED", FALSE}; // displays the current run state
fields[F_PULSE] = {"@", TRUE}; // displays indicator of system running
no match for 'operator=' (operand types are 's_field_def' and '<brace-enclosed initializer list>')
What am I doing wrong here?