Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!gh1r+ From: gh1r+@andrew.cmu.edu (Gaurang Hirpara) Newsgroups: comp.lang.c Subject: Re: Pointer Problems Message-ID: Date: 16 Aug 90 14:38:29 GMT Organization: Carnegie Mellon, Pittsburgh, PA Lines: 34 I got a variety of solutions, but perhaps I didn't state the problem clearly. The form ((StructName *)Something)->x=100 works. However, the format I need is this type: TopLevel->Secondary->Something->x=100; i.e. I can't do the casting in the middle of the dereference. It won't let me no matter which way I do it. Toplevel contains a pointer to Secondary, which contains Something. Something initially points to a void *. I want to be able to make it point to, say a struct StructName which has as one of its elements x, and be able to change that element. However, if I allocate space for Something by casting to StructName, it still has problems getting to x. Hope this makes the problem clearer. ~dan "Yes suh! The 'yarth (i.e. Earth) is flat! Says so the Psalms, about the four corners of the 'yarth. Now how you suppose a round thing has four corners suh?" --unknown Fundamentalist to Clarence Darrow, Scopes Trial ***************************************************************************** * Gaurang Hirpara | gh1r@andrew.cmu.edu | Starwatcher * * "Dan" to English speakers | ncrx@drycas.club.cc.cmu.edu| Con Artist * * Writer, Dreamer, Spy... | r746gh1r@vb.cc.cmu.edu | -------------- * *****************************************************************************