What will be output of following Statement ?

printf ( “%d”, ( x.a[i] )( p, q, r ) -> k ) ;

Ans: x is a structure variable. One of its elements is an array of pointers to functions. We are picking the ith pointer from this array. Using this pointer we are making a call to the function and passing it the arguments p, q, and r. The function in turn is returning a pointer to a structure, say z. We are printing an integer k which is an element of the structure z. Can you now write the prototype of the function being called?

The prototype would be:

struct z *f ( int p, int q, int r ) ;

Subscribe / Share

It's very calm over here, why not leave a comment?

Leave a Reply




Categories

Powered by Yahoo! Answers