Guest User

Untitled

a guest
Apr 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <dlfcn.h>
  3. int main()
  4. {
  5. int (*sum)(int, int);
  6. void *dl = dlopen("sum.so", RTLD_LAZY);
  7. if (!dl)
  8. {
  9. fprintf(stderr, "%s\n", dlerror());
  10. return 1;
  11. }
  12. sum = dlsym(dl, "sum");
  13. printf("%d\n", (*sum)(39, 3));
  14. }
Add Comment
Please, Sign In to add comment