Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. struct Foo  {
  2.     int something;
  3. }
  4.  
  5. static Foo foo;
  6.  
  7. void something_else(void (*getNextValue)(void))
  8. {
  9.     getNextValue();
  10. }
  11.  
  12. void some_callback(void)
  13. {
  14.     foo.something = 5
  15. }
  16.  
  17. int main(void)
  18. {
  19.     foo = ...
  20.     something_else(myarray, 10, getNextRandomValue);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement