Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
#include
// Operation is a new name for a pointer to a function // that takes two int values and returns an int typedef int (*Operation)(int, int); int add(int a, int b) { return a + b; } int multiply(int a, int b) { return a * b; } int main() { Operation op = add; printf("%d\n", op(5, 3)); // 8 op = multiply; printf("%d\n", op(5, 3)); // 15 return 0; }
8
15