you need to do it like this:Adjust the font size
Make textarea smaller
Make textarea bigger
Code:
typedef struct
{
    var x;
    var y;
    void fn(var x);    //The function pointer
} SPOT;
void func(var x)    //your function
{
    error("Hello world!");
}

SPOT* setup_spot()  //a init routine
{
    SPOT* spot = sys_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();
}



EDIT: Sorry, old code won't work!
don't know why code doesn't work without parameters...
with params it works

Last edited by Richi007; 09/03/10 09:43.

Visit my site: www.masterq32.de