Last active
May 10, 2022 09:10
-
-
Save developerjamiu/c1a96567981e9c3386e21a904064dc3a to your computer and use it in GitHub Desktop.
In your programming language of choice, pass a pointer to a function (A) to another function (b), then call A from B.
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
void main() { | |
b(() => print('I am function a passed to function b')); | |
} | |
/// Calling a function a from b | |
void b(Function a) { | |
print('This is the beginning of function b'); | |
print('before calling function a from b'); | |
a(); | |
print('after calling function a'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment