Skip to content

Instantly share code, notes, and snippets.

@developerjamiu
Last active May 10, 2022 09:10
Show Gist options
  • Save developerjamiu/c1a96567981e9c3386e21a904064dc3a to your computer and use it in GitHub Desktop.
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.
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