I get this error error: assignment to expression with array typ when I try this:
clients[0].data->bottle = x->bottle;
This is my code:
typedef struct {
int id;
some_data x;
uint64_t weight;
some_other_data_t *data;
} CLIENTS;
typedef struct {
uint8_t bottle[10];
} some_other_data_t;
some_other_data_t x;
extern CLIENTS clients[5];
/* some functions that set x correctly... */
clients[0].id = 1; // works fine!
clients[0].data->bottle = x->bottle; // does not work :(
Why is it so easy to set the id but so hard to set the data ?
I even tried to cast data to char* and use strcpy to set data
but it doesn't work...
How can I set data
?
I googled a lot but I didnt find a solution...