Skip to content
Create a gist now

Instantly share code, notes, and snippets.

#include <stdio.h>
int (*p[2]) (int x);
int printInt(int a)
{
printf("%d\n", a);
(*p[a / 1000]) (++a);
return a;
}
int doNothing(int a)
{
return a;
}
main()
{
p[0] = printInt;
p[1] = doNothing;
(*p[0]) (0);
return 0;
}
@n4kz

That's the right solution =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.