Created
December 21, 2012 06:29
-
-
Save Javran/4351049 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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