-
What will be the output of the following C code?
#include <stdio.h>
void (*(fun)())(int, float);
typedef void (*(*A)())(int, float);
void function(int k, float fun);
int main()
{
A = fun;
A();
}
void (*(fun)())(int, float)
{
return function;
}
void function(int k, float fun)
{
printf("%d %f\n", k, fun);
}
-
- Compilation Error
- Garbage value
- Nothing
- Undefined behaviour
- None of these
Correct Option: A
Compilation Error
main.c: In function ‘main’:
main.c:7:11: error: expected identifier or ‘(’ before ‘=’ token
A = fun;
^
main.c:8:11: error: expected identifier or ‘(’ before ‘)’ token
A();