


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



void one() { cout << "One \n "; } void two() { cout << "Two \n "; } int main() { void (*fptr)(); //Declare a function pointer to voids with no params
fptr = &one; //fptr - > one *fptr(); //=> one() fptr = &two; //fptr - > two *fptr(); //=> two() return 0 ; }
void one() { cout << "One \n "; } void two() { cout << "Two \n "; } int main() { void (*fptr)(); //Declare a function pointer to voids with no params fptr = one; //fptr - > one fptr(); //=> one() fptr = two; //fptr - > two fptr(); //=> two() return 0 ; }
void one(int a, int b) { cout << a+b << " \n "; } void two(int a, int b) { cout << a*b << " \n "; }