Created
April 10, 2017 02:46
-
-
Save sutirthaC97/b9bf7b5e15e714d6d77d627e5a08dcc8 to your computer and use it in GitHub Desktop.
Function pointer example in 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 say(char* s){ | |
printf("%s",s); | |
} | |
int main() | |
{ | |
void (*say_ptr)(char* s) = &say; | |
say("\nHello!"); | |
(*say_ptr)("\nHello!"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment