#include <default.c>
#include <litec.h>
typedef struct
{
int x;
int y;
void fn(int x); //The function pointer
} SPOT;
void func(int x) //your function
{
error("Hello world!");
}
SPOT* setup_spot() //a init routine
{
SPOT* spot = malloc(sizeof(SPOT));
spot->x = 0;
spot->y = 0;
spot->fn = func; //Set fn as func
return spot;
}
void main()
{
SPOT* spot = setup_spot(); //create SPOT
spot->fn(5); //call func();
}