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 ) ;

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>