What am I doing wrong here? This compiles:
void myfunc(int a, char *s) {
}
void test2(void (*process_function)(int, char *)) {
}
void test1() {
test2(myfunc);
}
However, when I change myfunc to return an integer, I get a compile error. i.e.
int myfunc(int a, char *s) {
return 1;
}
void test2(int (*process_function)(int, char *)) {
}
void test1() {
test2(myfunc);
}
The error is "error: variable or field 'test2' declared void In function 'void test1()':". It doesn't seem to like the function pointer referring to a function that returns a value. Any ideas?
Thanks,
Julian