Skip to content

Instantly share code, notes, and snippets.

@Javran
Created December 21, 2012 06:29
Show Gist options
  • Save Javran/4351049 to your computer and use it in GitHub Desktop.
Save Javran/4351049 to your computer and use it in GitHub Desktop.
#include <stdio.h>
typedef int (*callable)();
typedef struct
{
callable f;
} call_st;
int print()
{
printf("nice boat!\n");
return 0;
}
int main()
{
call_st cs = { print };
(*((callable *)(void *)(&cs)))();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment