Here is code which fixes the errors you ask about and a few others.
Without a MCVE it is hard to get it completely working.
You have some design changes coming up, to make the function work on any kind of variable, not only globals.
Making a nested function is not a good way to make a local variable accessable in a funciton. Get the code working on a global, then change to work on call-by reference variables.
The ++
indicate a more complex plan you are following. Do that later.
get example1_st[3]; // changed to the obviously intended name,
// should fix 'declaration is incompatible with previous "memcmp"'
// made this a global, to keep it accessable from function,
// make the code work, then refactor to have the function work on
// variables via call-by reference parmeters
// avoid nested function definition
get* example(void)
{
uint_8 l_LoopCounter_u8=0; // init index variable
example1_st.a[l_LoopCounter_u8] = data; // removed ++, which is unnclear/risky here
example1_st.b[l_LoopCounter_u8] = data;
example1_st.c[l_LoopCounter_u8] = data;
return &example1_st ; // no need to cast to void, type is correct
}
int main(void) //changed to a correct main function head,
// should fix "expected a type specifier"
{
// note that your main function was functionally empty anyway...
}
Note:
No, I did not test this code. It would be hard for lack of a MCVE by OP.
This is meant to help with problems, not deliver working code for unknown purpose.