Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!rochester!kodak!ispd-newsserver!rpi!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!lobster!shell!shell!rjohnson From: rjohnson@shell.com (Roy Johnson) Newsgroups: comp.lang.c Subject: Re: syntax help Message-ID: Date: 21 Mar 91 16:03:40 GMT References: Sender: usenet@shell.shell.com (USENET News System) Organization: Shell Development Company, Bellaire Research Center, Houston, TX Lines: 22 In-Reply-To: wayne@cs.odu.edu's message of 20 Mar 91 17:53:18 GMT In article wayne@cs.odu.edu (C Wayne Huling) writes: > I keep getting errors from this, I don't understand the structure used > for namelist?? How do I access this? I keep getting: > "t.c", line 14: warning: struct/union or struct/union pointer required > [...] > struct direct *(*namelist[100]); > [...] > printf("%s\n",namelist[i]->d_name); namelist is array of pointers to pointers to struct direct, but you are accessing it as if it's array of pointers to struct. One more level of indirection: printf("%s\n",(*namelist[i])->d_name); should do it. This post valid unless superceded by a post by Chris Torek, Doug Gwyn, or Karl Heuer (where is he, anyway?), or other comp.lang.c gurus. -- ======= !{sun,psuvax1,bcm,rice,decwrl,cs.utexas.edu}!shell!rjohnson ======= Feel free to correct me, but don't preface your correction with "BZZT!" Roy Johnson, Shell Development Company