Path: utzoo!mnetor!uunet!lll-winken!lll-tis!mordor!sri-spam!ames!ucsd!chem.ucsd.edu!tps From: tps@chem.ucsd.edu (Tom Stockfisch) Newsgroups: comp.lang.c Subject: Re: style Message-ID: <192@chem.ucsd.EDU> Date: 26 Apr 88 23:13:27 GMT References: <13115@brl-adm.ARPA> <7770@brl-smoke.ARPA> Reply-To: tps@chem.ucsd.edu (Tom Stockfisch) Organization: Chemistry Dept, UC San Diego Lines: 25 In article <7770@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article <13115@brl-adm.ARPA> jfjr@mitre-bedford.arpa (Freedman) writes: >> Now, as a former Pascal programmer I like the typedef method >>MUCH better than the tag method... >Typedef was added to C after struct tags...Sometimes it is easier to >use tags, though, as in > struct my_tag { > struct my_tag *link; > data_t data; > }; In this case you can use typedef struct LIST { struct LIST *link; data_t data; } LIST; since tags and typedefs are in different overload classes. This usage is not strange looking if you think of the initial "struct LIST" as meaning "BEGIN LIST DECLARATION" and the final "LIST;" as "END LIST DECLARATION". -- || Tom Stockfisch, UCSD Chemistry tps@chem.ucsd.edu