+ 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 );
4 ответов
+ 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
);
}
+ 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
);
0
Where is blanks..? What is your question actually?
0
1.) return
2.)*
3.)42