Structure pointer question

Michael T Sullivan sullivan at vsi.UUCP
Wed Jun 15 00:39:02 AEST 1988


In article <8074 at brl-smoke.ARPA>, gwyn at brl-smoke.ARPA (Doug Gwyn ) writes:
> In article <361 at teletron.UUCP> andrew at teletron.UUCP (Andrew Scott) writes:
> >Is it alright to #include "foo.h" and not "bar.h" in a source file if the
> >fields of "struct bar" are not used?
>
> you declare a complete type for "struct bar".  The easiest thing to do
> is to have "foo.h" include "bar.h" right after the incomplete "struct foo"
> declaration.  Then the application doesn't have to worry about it.

Which brings up a question:  is it considered a good thing or a bad thing
to have .h files #include'ing other .h files instead of having the .c files
do it all.  The rule around here is that there are to be no #include's in
.h files we write.  Mail me your opinions for or against.

-- 
Michael Sullivan		{uunet|attmail}!vsi!sullivan
V-Systems, Inc.  Santa Ana, CA	sullivan at vsi.com
HE V MTL			<-That's my license plate, is yours any better?



More information about the Comp.lang.c mailing list