Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: Indefinite-length array as member of struct: how? Message-ID: <1989Jul7.155055.18983@utzoo.uucp> Organization: U of Toronto Zoology References: <7360@c3pe.UUCP> Date: Fri, 7 Jul 89 15:50:55 GMT In article <7360@c3pe.UUCP> charles@c3pe.UUCP (Charles Green) writes: >I have an application where I'm building and manipulating a stack of >variable-length strings... > >struct node { > struct node* next; > char string[]; >} *nodeptr; I believe I recall Dennis Ritchie once characterizing this sort of thing as "unwarranted chumminess with the compiler"! I suspect that a close reading of the draft C standard says you can get away with it, but it's still cheating in at least a small way. If you want to shut your compiler up, try making that "[1]". -- $10 million equals 18 PM | Henry Spencer at U of Toronto Zoology (Pentagon-Minutes). -Tom Neff | uunet!attcan!utzoo!henry henry@zoo.toronto.edu