Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!attctc!bobc From: bobc@attctc.Dallas.TX.US (Bob Calbridge) Newsgroups: comp.lang.c Subject: self contained pointers to structures Keywords: strange interaction Message-ID: <10350@attctc.Dallas.TX.US> Date: 27 Nov 89 04:01:09 GMT Distribution: na Organization: The Unix(R) Connection, Dallas, Texas Lines: 29 Here's one that confounded me. I wanted to link a number of records of the same type. Each record would have the same structure and would contain a pointer to the next record. I tried to implement it like this: struct event { int timing: int count; struct event *next; }; Of course, the compiler complains because the definition of the structure is incomplete at that point. From a practical point of view this shouldn't matter since the space into which the record will go be allocated memory. Does this mean that I can define the pointer 'next' as char * and then do some coercion in my code. I won't be using these structures in an array so all I feel I really need is some pointer into memory. Or should I define a similar structure and reference a pointer to it? This does present the problem of what the struct * would have to be in that definition. I suspect that this subject has been discussed before but it didn't have my attention at the time. bobc@attctc -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- = I know it's petty.......... = - But I have to justify my salary! - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=