Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. typedef void (*cbType)();
  4. void call(int, cbType);
  5. void callback(int*);
  6.  
  7. int main()
  8. {
  9.     call(155, &callback);      
  10.     return 0;
  11. }
  12.  
  13. void call(int data, cbType cb)
  14. {
  15.     printf("Call\r\n");
  16.     cb(&data);
  17. }
  18.  
  19. void callback(int * data)
  20. {
  21.     printf("Callback\r\n");
  22.     printf("Data: %d\r\n", *data);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement