Created
August 21, 2018 18:38
-
-
Save jfo/ca6d575219788d7c7fa2a93b22b0e09c 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 lib1f(void (*f)()) { | |
printf("lib1 now calling function:\n"); | |
f(); | |
printf("lib1 done!\n"); | |
} | |
void lib2f(void (*f)()) { | |
printf("lib2 now calling function:\n"); | |
f(); | |
printf("lib2 done!\n"); | |
} | |
void udf() { | |
printf("Hello World!\n"); | |
} | |
void *g = NULL; | |
void tf () { | |
lib2f(g); | |
} | |
void mergelibf(void (*f)()) { | |
g = f; | |
lib1f(tf); | |
} | |
int main() { | |
mergelibf(udf); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment