Skip to content

bad type declaration #34

@ClaudioDaffra

Description

@ClaudioDaffra

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions