+ 3

Fill in the blanks to declare a function that returns the square of its argument, call it with the value 42 using a function poi

int sqr(int n) { return n * n; } int ( * fp)(int) = sqr; int x = fp( 42 );

30th Aug 2020, 4:39 PM
SAGAR ROHILLA
SAGAR ROHILLA - avatar
4 Réponses
+ 5
Here blank not showing i fixed your program see this #include <iostream> using namespace std; int sqr(int n) { return n * n; } int main() { int ( * fp)(int) = sqr; cout<<fp( 42 ); }
30th Aug 2020, 4:44 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Fill in the blanks to declare a function that returns the square of its argument, call it with the value 42 using a function pointer. int sqr(int n) { return n * n; } int ( * fp)(int) = sqr; int x = fp( 42 );
4th Jun 2021, 9:36 AM
Neel Ksaodariya
Neel Ksaodariya - avatar
0
Where is blanks..? What is your question actually?
30th Aug 2020, 4:45 PM
Jayakrishna 🇮🇳
0
1.) return 2.)* 3.)42
5th Jul 2021, 3:50 PM
SRIDHARAN.S
SRIDHARAN.S - avatar