Say I have the following code:
struct test* t1;
t1 = get_t(1);
… where get_t is:
struct test* get_t(int);
How can I refactor the above code and put it in a function? Something like the following:
void r1(?* t, ?* (fn*)(int)) {
t = fn(1);
}
/* ... */
struct test* t1;
r1(t1, &get_t);
use
void *param, a pointer to anything … commonly used in glib asgpointer