I have a function which is defined:
uint32_t match_data(uint8_t * data_in, uint16_t size_data_in);
where I am trying to use the following typedef struct as an argument
typedef struct
{
uint8_t chars[5]
uint8_t ADC;
}Data
Data input;
input.chars[0] = 65;
input.chars[1] = 66;
input.chars[2] = 67;
input.chars[3] = 68;
input.chars[4] = 69;
input.ADC = 255;
match_data((uint8_t *)input, sizeof(input));
match_data() function is returning Operand of type 'Data' where arithmetic or pointer type is required
How can I cast a typedef struct to uint8_t? if I use it as a reference & I get the same error
I can cast it directly if I use only the char array, but not when using a typedef struct
match_data((uint8_t *) &input, sizeof(Data));- sturcotte06