home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!asuvax!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
- From: dave@cs.arizona.edu (Dave Schaumann)
- Newsgroups: comp.lang.c
- Subject: Re: struct vs. typedef
- Message-ID: <1993Jan13.035920.13278@organpipe.uug.arizona.edu>
- Date: 13 Jan 93 03:59:20 GMT
- References: <uRL4wB7w165w@cybrspc.uucp> <1993Jan11.170937.22822@informix.com> <1993Jan13.020738.9171@massey.ac.nz>
- Sender: news@organpipe.uug.arizona.edu
- Reply-To: dave@cs.arizona.edu (Dave Schaumann)
- Organization: University of Arizona
- Lines: 27
- In-Reply-To: news@massey.ac.nz (USENET News System)
-
- In article <1993Jan13.020738.9171@massey.ac.nz>, news@massey (USENET News System) writes:
- >I prefer,
- >
- >#define ITEM struct n
- >
- >typedef ITEM {
- [...]
- >};
-
- Echh! IMHO, this is bletcherous. The biggest abuse of the preprocessor
- I can think of is to use it to hide keywords; to make the language look
- like something it's not.
-
- Why not just do it like this:
-
- typedef struct foo *foo_ptr ;
-
- struct foo {
- /* whatever */
- foo_ptr succ, pred ;
- } ;
-
- --
- You unlock this door with the key of imagination. Beyond it is another
- dimension: a dimension of sound, a dimension of sight, a dimension of mind.
- You're moving into a land of both shadow and substance, of things and ideas.
- You've just crossed over into... the Twilight Zone.
-