adjectives for typedef'd names

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Sat May 12 11:22:59 AEST 1984

PCC happens to treat ``typedef''ed names exactly the same as the
thing to which they are typed.  (At least, if you say

	typedef int foo;

	main () {
		register unsigned foo i;
		short foo;

you get one ``register unsigned int'' and no ``short int''s.)  I
prefer this, because this is the way I think of them.  In fact I
used to get the order of ``typedef'' backwards, because I thought
of them as ``glorified #define's''.  (The one advantage they have
over #define's is that they can make things syntactically simpler,

	typedef int (*pfun)();	/* pointer to function returning int */
	pfun table[] = { ... };	/* a table of pointers to functions */

In-Real-Life: Chris Torek, Univ of MD Comp Sci (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