Hi, I'm trying to succeed in a function pointer. what is wrong with the compiler says: syntax error: token -> 'code' ; column 18
#include <string.h> char str1[10]; xdata unsigned int i; xdata unsigned int ret; code *call; typedef void (code *callback); (void); // syntax error: token -> 'code' extern callback xdata statefunc; void main(void) { strcpy(str1, "testing"); }
typedef void (code *callback); (void); // syntax error: token -> 'code'
If this is copied and pasted original source code, I'd check the number of semicolons in that line.
Hi,
The semicolon it's not the problen, it is only my typo.
The probem is that line typedef void (code *callback)(void);
timok
You should remove the code keyword. I can imagine a line of reasoning that would put it there, but it's arguable. And, apparently, the compiler will not accept it.
You may also read this: www.newty.de/.../fpt.html