Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!think!samsung!uunet!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: typedef vs define Message-ID: <639@sixhub.UUCP> Date: 17 Mar 90 21:03:42 GMT References: <82@demott.COM> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 21 In article <82@demott.COM> kdq@demott.COM (Kevin D. Quitt) writes: | Someone posted on this subject a very clear eaxmple of things that | could be done with typedefs that couldn't be done with defines. I don't have it handy, but here are a few. typedef int *IPTR; /* all items will be pointer to int */ typedef int SVECT[5]; /* type "array length five of int" */ A define won't allow you to do those so you could say: IPTR dmo1, *dmo2, dmo3[5]; SVECT xmpl1, *xmpl2, *xmpl3[5]; -- bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen) sysop *IX BBS and Public Access UNIX moderator of comp.binaries.ibm.pc "Getting old is bad, but it beats the hell out of the alternative" -anon