+ 1
Sqr
What’s that mean || Int(*fp)(int)=sqr ???
1 Antwort
+ 3
int (*fp)(int) x;
declares a pointer to a function of return type int, which takes one argument of type int. What you can achieve with this, is to create aliases to existing functions, such as
int func(int p) { return p+1; }
int (*fp)(int) x = func;
You can then call func() using x.
printf("%d", x(39));
// prints 40
Somewhat identical:
https://code.sololearn.com/c7yvjIx5hWsw/?ref=app