Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int square(int a) { return a * a; }
- typedef int (*square_fp)(int);
- typedef struct {
- int x;
- square_fp fp;
- } data;
- int main(void) {
- data test;
- test.x = 40;
- test.fp = square;
- printf("%d", test.fp(test.x));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement