Using data types before they are declared.

William Davidsen davidsen at sungod.crd.ge.com
Tue Jun 20 03:51:13 AEST 1989


In article <18137 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:

| The best approach is to ignore `typedef' completely, give all
| structures and unions tags, and add typedefs afterward if you
| wish.  Thus:

  definitions are sometimes useful to reduce typing as well. For
instance in a simple linked list declaration:

	#define D_litem struct _litem

	D_litem {
	  int xa[4], xb[4];
	  D_litem *fwd, *back;
	  float lo_lim, hi_lim;
	  D_litem *execptions;
	};
	typedef D_litem litem

  This is a real typing saver when a number of structs include one
another or pointers to one another.
	bill davidsen		(davidsen at crdos1.crd.GE.COM)
  {uunet | philabs}!crdgw1!crdos1!davidsen
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.lang.c mailing list