Created
August 30, 2018 06:11
-
-
Save suzukiplan/094e0cd7f64094e9a5662999274666da to your computer and use it in GitHub Desktop.
Callback example for C
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
#include <stdio.h> | |
void functionWithCallback(void(*callback)(int, int)) { | |
callback(1234, 5678); | |
} | |
void callback(int a, int b) { | |
printf("a=%d, b=%d\n", a, b); | |
} | |
int main() { | |
functionWithCallback(callback); | |
return 0; | |
} |
Author
suzukiplan
commented
Aug 30, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment