Is typedef char BUFFER[20] legal?

Scott Amspoker scott at bbxsda.UUCP
Wed Feb 6 09:21:47 AEST 1991


In article <1212 at tredysvr.Tredydev.Unisys.COM> paul at tredysvr.Tredydev.Unisys.COM (Paul Siu) writes:
>Is the following statements legal in K&R C, and ANSI C?
>     typedef char BUFFER[20];
>     BUFFER sb;
>This seems to work on both the K&R compiler and the ANSI compiler at my work
>place, but is this going to break when the program is ported?

Looks good to me but you never know how bad some compilers can be.

>Can anyone also tell me what is the most common style convention for type
>names, I usually put them all in capitals.

You're not alone here.  We tend to use uppercase names for typedefs also.

-- 
Scott Amspoker                       | 
Basis International, Albuquerque, NM |     This space available
(505) 345-5232                       | 
unmvax.cs.unm.edu!bbx!bbxsda!scott   |



More information about the Comp.lang.c mailing list