Article View: comp.sys.amiga.tech
Article #2102C pointer question.
From: Wade Bickel
Date: Mon, 13 Nov 1989 07:36
Date: Mon, 13 Nov 1989 07:36
39 lines
1820 bytes
1820 bytes
I'm writing a set of memory management routines and have run across
a dereferencing of pointers I cannot seem to express.
In the routines in question, a header is prefixed to allocations and
doubly linked lists are maintained. The list head pointer is passed by
reference, and I'd like to modify something that it is pointing at. It
looks something like this,
void *ListAlloc(list,size)
struct AllocList **list;
ULONG size;
{
...
...
(*(*list)).prev = something; /* ??? gives "invalid structure
reference" error
*/
}
I've tried all the variations of "*" and "->" I can think of but none
seem to work. I'm using Lattice 5.04.
For the meantime I've seperated the dereferencing into two steps, but
since it is only done once per routine this seems a waste. Any help would be
greatly appreciated as I've been running into this problem repeatedly, and
in a few cases what should fit on one line with no temporary variables has
ended up taking four lines and several temps.
Thanks,
Wade W. Bickel
UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!wade
ARPA: crash!pnet01!wade@nosc.mil
INET: wade@pnet01.cts.com
Technical Details
Message-ID:
<698@crash.cts.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!ucsd!helios.ee.lbl.gov!nosc!crash!pnet01!wadeShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!ucsd!helios.ee.lbl.gov!nosc!crash!pnet01!wade From: wade@pnet01.cts.com (Wade Bickel) Newsgroups: comp.sys.amiga.tech Subject: C pointer question. Message-ID: <698@crash.cts.com> Date: 13 Nov 89 07:36:16 GMT Sender: root@crash.cts.com Organization: People-Net [pnet01], El Cajon CA Lines: 39