Skip to content

Instantly share code, notes, and snippets.

@Cvar1984
Created August 18, 2023 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cvar1984/5b30a1364883192e939d74d94734eb21 to your computer and use it in GitHub Desktop.
Save Cvar1984/5b30a1364883192e939d74d94734eb21 to your computer and use it in GitHub Desktop.
callback in C
#include <stdio.h>
void call(void(*ptr)()) {
ptr();
}
void printString()
{
printf("Hello\n");
}
int main()
{
void *ptr = &printString;
call(ptr);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment