#include struct mathops { int (*main_op)(int); }; int cube(int x){ return x*x*x; } int main(){ int n = 3; printf("cube(n) = %d\n", cube(n)); struct mathops my_math; my_math.main_op = cube; // A function pointer is stored in a structure printf("main op applied to 16 = %d\n", my_math.main_op(16)); // Using a function pointer in a struct struct mathops *ptr_to_mymath; ptr_to_mymath = &my_math; printf("main op applied to 4 = %d\n", (*ptr_to_mymath).main_op(4)); // Using a function pointer in a struct printf("main op applied to 5 = %d\n", ptr_to_mymath->main_op(5)); // Using a function pointer in a struct if(8 && 6){ printf("8 && 6\n"); } else { printf("NOT 8 && 6\n"); } if(8 & 6){ printf("8 & 6\n"); } else { printf("NOT 8 & 6\n"); } return 0; }