Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!nmtsun!dwho From: dwho@nmtsun.nmt.edu (David Olix) Newsgroups: comp.lang.c Subject: Re: Indefinite-length array as member of struct: how? Message-ID: <2831@nmtsun.nmt.edu> Date: 7 Jul 89 19:45:11 GMT References: <7360@c3pe.UUCP> <1989Jul7.155055.18983@utzoo.uucp> Reply-To: dwho@nmtsun.nmt.edu (David Olix) Organization: New Mexico Tech, Socorro NM Lines: 12 >regarding variable-length strings... > >struct node { > struct node* next; > char string[]; >} *nodeptr; > >If you want to shut your compiler up, try making that "[1]". I guess I am unclear on something here. If you define string as 'char string[1];', that only gives you one char's worth of space in string. If that's the case why don't you define string as 'char string;'?