struct s { void (*f)(struct s *, int); }; void func1(struct s *ret, int arg) { void func2(struct s *, int); ret->f = func2; }