In my arduino sketch I need an array of function pointers with the signature void foo()
.
I'm using the ino
command line utillity on linux (which uses avr-g++ under the hood).
However I'm getting a very strange error while defining the array.
error:
error: invalid conversion from ‘void (* (*)())()’ to ‘void (*)()’
in this piece of code
void (*mode_setup[])(void) = {
&show_time_setup,
&set_time_setup,
&set_alarm_setup,
&set_date_setup // <-- generates 3 identical error on this line
};
I don't understand what I'm doing wrong, since... int foo[] = { 1, 2, 3 };
..is perfectly valid, and void (*foo)(void)
is the syntax for function pointer.
what am I missing?
edit: NEVERMIND IM STUPID the functions were not void foo(), but fptr foo() [fptr=function pointer typedef] sincere appologies for wasting peoples time