Hi,
I want to typedef a function pointer, but getting some errors.
This is the code:
How to give this typedef statement?
I want to typedef a function pointer, but getting some errors.
This is the code:
Code:
#include <stdio.h>
typedef ((int) (*) (int, int)) Callback;
Callback cb;
int add(int i, int j)
{return (i+j);}
int main()
{ cb = &add;
int res;
res = cb(10, 20);
printf("%d", res);
return 0;
}
Comment