Home » C Programming » Pointers » Question
  1. 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);
    }
    1. Compilation Error
    2. Garbage value
    3. Nothing
    4. Undefined behaviour
    5. 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();



Your comments will be displayed only after manual approval.