Examveda

What will be the output of the following C code?
#include <stdio.h>
void f(int (*x)(int));
int myfoo(int);
int (*fooptr)(int);
int ((*foo(int)))(int);
int main()
{
    fooptr = foo(0);
    fooptr(10);
}
int ((*foo(int i)))(int)
{
    return myfoo;
}
int myfoo(int i)
{
    printf("%d\n", i + 1);
}

A. 10

B. 11

C. Compile time error

D. Undefined behaviour

Answer: Option B


This Question Belongs to C Program >> Pointer

Join The Discussion

Related Questions on Pointer