Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!psuvax1!brutus.cs.uiuc.edu!samsung!uunet!mstan!amull From: amull@Morgan.COM (Andrew P. Mullhaupt) Newsgroups: comp.lang.c Subject: Re: typedef vs #define Summary: What did I say? Keywords: difference Message-ID: <759@s5.Morgan.COM> Date: 27 Feb 90 19:01:53 GMT References: <8430@cbnewsh.ATT.COM> <752@s5.Morgan.COM> <24495@princeton.Princeton.EDU> Distribution: usa Organization: Morgan Stanley & Co. NY, NY Lines: 23 In article <24495@princeton.Princeton.EDU>, nfs@notecnirp.Princeton.EDU (Norbert Schlenker) writes: ! ! But beware. If we change the question only slightly, to: ! Consider the following two C statements: ! typedef short * FLAGS ! #define FLAGS short * ! ! Now there's a considerable difference between the two. Imagine the ! declaration: ! ! FLAGS x, y; ! ! The typedef results in (probably) what people expect, namely that both ! x and y are pointers to short int. The #define makes x a FLAGS and y ! a short, probably not what you want. I clearly pointed out this distinction in the quote I gave from K&R2 in my posting. Did only a fragment get all the way over the net? Also: I am posting this because I can't get mail to you... Later, Andrew Mullhaupt