C wizards's puzzle #1

utzoo!decvax!ittvax!swatt utzoo!decvax!ittvax!swatt
Thu Nov 11 14:53:51 AEST 1982


This is more in the line of a "C RE-bugging Contest", or how to do
things no sane person would want to do in the first place.

Given the function:

	func (a)
	int a;
	{
		<stuff>
	}

In the place of <stuff>, coerce the integer "a" into the type:

	pointer to function returning pointer to function returning
	pointer to 'int'.

and call the function whose address is returned by calling the function
to which the coerced value now points and pick up the integer pointed
to by the final return.

Notes:

	You are not allowed to use "typedef" statements to build
	up intermediate types.

	This must all be done on one line, although the line may
	be of any length.

	You have at most 30 minutes.



More information about the Comp.lang.c mailing list