AD1

Tuesday, 28 February 2017

what is the output of this program


#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;
}
view raw ptof.c hosted with ❤ by GitHub
output
10 segmentation fault

explanation


No comments:

Post a Comment