Examveda

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

A. Compile time error

B. Undefined behaviour

C. 10 11

D. 10 Segmentation fault

Answer: Option D


This Question Belongs to C Program >> Pointer

Join The Discussion

Related Questions on Pointer