edited by
428 views
1 votes
1 votes
void main()

{

int *x;

x =f();

printf("%d", *x);

}

int *f()

{

int y = 7 ;

return &y;

}
edited by

1 Answer

0 votes
0 votes
yes, ans is unexpexted because when function definition is completed then local variable of function will discard

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
4
altamash asked Apr 12, 2019
329 views
int main();{int a,*b, c, *d, e;a=10;b=&a;c=&b;d=&c;e=&d;print f(“a=%d b=%u c=%u d=%u e=%u e=%u\n”, a,b,c,d,e);print f(“ %d %d %d \n”,a,a+*b, c+ *d+, e);return 0...