Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!elroy!usc!hacgate!ashtate!dbase!awd From: awd@dbase.UUCP (Alastair Dallas) Newsgroups: comp.lang.c Subject: Re: typedefing arrays Summary: Another example Keywords: kludge hack bogus Message-ID: <97@dbase.UUCP> Date: 10 Jun 89 20:54:19 GMT References: <4636@alvin.mcnc.org> <17895@mimsy.UUCP> Organization: Ashton Tate Devlopment Center Glendale, Calif. Lines: 35 In article <17895@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: > In article <4636@alvin.mcnc.org> spl@mcnc.org (Steve Lamont) writes: > > Is it possible to do something like > > > > typedef int vertex[3]; > > > >Is this a sensible thing to do? > > Yes. > Of course it is. For example, I like: typedef char FNAME[]; Then you can have things like: func(FNAME name, int arg) { FNAME temp; strcpy(temp, name); if (temp[1] == ':') /* drive specified */ ; if (!strcmp(temp, name)) ; ...and so on... There are lots of good uses for typedef'd arrays. /alastair/