Created
February 28, 2016 21:06
-
-
Save apaszke/f754d38e09e4579fc0d3 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> | |
void print() { | |
printf("called!\n"); | |
} | |
typedef void (*fn)(); | |
struct callvec { | |
fn function; | |
}; | |
struct callvec test = { | |
}; | |
void dynamicdispatch() { | |
test.function(); | |
} | |
int main() { | |
dynamicdispatch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment