I want to use pointer variables who points to functions.
I did this piece of code, compile well, but didn't run it correctly :s
Code: Select all
#include <tamtypes.h>
#include <debug.h>
typedef void (*proc)(int);
void test(int integer) {
scr_printf("%d\n",integer);
}
int main() {
init_scr();
proc fct = &test;
fct(2);
return 0;
}
I don't remember exactly but i did such a program in C for linux and this kind of program worked.
Any idea ???
Thx