zsaleeba / picoc

A very small C interpreter
1.45k stars 183 forks source link

bad type declaration #34

Open ClaudioDaffra opened 6 years ago

ClaudioDaffra commented 6 years ago

i have triedto run 42_function_pointer.c example but gives me an error about function pointer : bad type declaration <-- int (*f)(int) = &fred;

#include <stdio.h>

int fred(int p) {
    printf("yo %d\n", p);
    return 42;
}

int (*f)(int) = &fred;

int main()
{
    printf("%d\n", (*f)(24));
    return 0;
}