Advertisement
dtung

Untitled

Apr 7th, 2020
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. // To pass one function to another, one might say
  2. int f(void);
  3. /* ... */
  4. g(f);
  5.  
  6. // Then the definition of g might read
  7. void g(int (*funcp)(void))
  8. {
  9.     /* ... */
  10.     (*funcp)(); /* or funcp(); ... */
  11. }
  12.  
  13. // or, equivalently,
  14. void g(int func(void))
  15. {
  16.     /* ... */
  17.     func(); /* or (*func)(); ... */
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement