Hi,
I have a func pointer in a structure like this-
I initialize this func pointer in a function like this-Code:struct mystruct { int (*fp)(int,int); }mystruct;
thenI'm trying to use this function pointer in another function, like this-Code:void Init(mystruct *handle,int (*my_fp)(int,int)) { handle->fp=my_fp; }
Somehow, it is giving me a lot of syntax errors. Please tell me what I'm doing wrong here!Code:int func(mystruct *handle) { int c=handle->fp(1,2); return c; }



1Likes
LinkBack URL
About LinkBacks


