Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!abvax!iccgcc!browns From: browns@iccgcc.decnet.ab.com (Stan Brown) Newsgroups: comp.lang.c Subject: Re: Is typedef char BUFFER[20] legal? Message-ID: <3079.27ad5c52@iccgcc.decnet.ab.com> Date: 4 Feb 91 18:06:26 GMT References: <1212@tredysvr.Tredydev.Unisys.COM> <1991Jan29.210100.8105@zoo.toronto.edu> <22642@netcom.UUCP> Lines: 21 In article <22642@netcom.UUCP>, avery@netcom.UUCP (Avery Colter) writes: > My instinct right now is telling me that > > typedef char[20] BUFFER > > is more consistent... > > But I'll take the word of the more experienced that the first def > can be done too. typedef char BUFFER[20]; is legal C. I believe that what you wrote is not legal C. The general rule for writing typedefs is: write a normal variable declaration, stick 'typedef' on the front, and the variable name becomes the type name. Thus BUFFER is the name of a type that is array (20 long) of char. Hey--this is all my opinion, nobody else's. Rely on it at your peril. email: browns@iccgcc.decnet.ab.com Stan Brown, Oak Road Systems, Cleveland, Ohio, USA +1 216 371 0043