invalid type argument of '->' (have 'otethdalctrlconfig' {aka 'struct…
- User
invalid type argument of '->' (have 'ot_eth_dal_ctrl_config' {aka 'struct s_ot_eth_dal_ctrl_config'})
- Assistant
This error message occurs when you are trying to access a member of a variable using the
->operator, but the variable is of an invalid type.In this case, the variable
ot_eth_dal_ctrl_configis of typestruct s_ot_eth_dal_ctrl_configand you are trying to access a member using the->operator. However, the->operator is only used with pointers.To fix this error, you need to make sure that
ot_eth_dal_ctrl_configis a pointer to the structs_ot_eth_dal_ctrl_config. You can do this by declaring it as a pointer and allocating memory for it:struct s_ot_eth_dal_ctrl_config* ot_eth_dal_ctrl_config = malloc(sizeof(struct s_ot_eth_dal_ctrl_config));Or, if
ot_eth_dal_ctrl_configis already declared as a pointer, make sure it is properly initialized before using the->operator:struct s_ot_eth_dal_ctrl_config* ot_eth_dal_ctrl_config; // ... ot_eth_dal_ctrl_config = some_function_that_returns_pointer(); ot_eth_dal_ctrl_config->member_name = value; // Accessing struct member using the -> operatorMake sure to handle memory allocation and deallocation properly to avoid memory leaks and undefined behavior.