Re: struct syntax



On Mon, Jul 02, 2001 at 07:28:42AM -0400, Owen Taylor wrote:
> You frequently want forward declarations because:
> 
>  A) Your structures are opaque to user code [ a "good thing" ]

I don't understand how a forward declaration and struct definition in
the same header makes things opaque.

>  B) Your structures reference each other recursively, or
>     reference themselves.

I can see that forward declarations are necessary for linked lists and
other data structures.

>  C) You simply don't want to have to worry about ordering.

What do you mean by ordering?  The order of the struct members or the
order in which the structs are defined/declared?

-- 
Nathan Cullen
furyu fuse net






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]