C to Pascal translation.

Chris Torek chris at umcp-cs.UUCP
Sun Dec 16 11:34:57 AEST 1984


In general, it cannot be done.  What would you do with

	union u {
		int (*f)();
		char *c;
	} u;

	h() {
		u.c = "foo";
	}

	g() {
		u.f = h;	/* Remember, I'm actually allowed to
				   make this assignment as complicated
				   as I want.  Maybe it depends on
				   input data.... */
	}

	main () {
		g();
		(*u.f)();
		printf("%s\n", u.c);
	}

If you make some restrictions, then it can sort of be done.
-- 
(This line accidently left nonblank.)

In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland



More information about the Comp.lang.c mailing list