Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 28 Nov 2012 00:35:01 -0600 Message-ID: <50B5B095.47C1@mindspring.com> Date: Wed, 28 Nov 2012 01:35:01 -0500 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: what is the best way References: <50b4d9fc$0$3108$ba620e4c@news.skynet.be> <87d2yyfh9h.fsf@riseup.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Lines: 46 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.220.227 X-Trace: sv3-juCIzVMh4jHFEQL6/WnXVS3hU4nIMKQMwdfKWCi/SYwDhWOlxLqx+H34v3BhDcfi+5Rz4wp6O/2aAJS!quqDnfojbqwzeh/g1TPL3NCLXYnp6i0Kvv25fY3Xkk6CbeRGeGYTrXOx6n0bTYAu17lJSUQJrTYV!Fnif1P2+BDY= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2369 Xref: csiph.com comp.lang.c:28721 Sergio Durigan Junior wrote: > > On Tuesday, November 27 2012, Les Cargill wrote: > > > Andre wrote: > >> to organize source in a multi soucres project. > >> Is a main.h file with every definition for every sources the best or > >> a each.h file for each.c file the best. > >> It's a verry loooong time last I used c. > >> André > > > > > > There is no "best". [...] > > Agreed. > > > - Have all the #includes needed for that .c file #included in the .h > > file. That way, if there are 7 c files, "grep "#include" *.c | wc " > > will > > be 7. > > Not really sure I agree. I prefer having my #includes in the .c, > because I believe the header file, if it needs to be included by other > .c files, must not interfere much with them, i.e., > they shouldn't carry > other (possible obscure) header files that won't be needed for the .c > file(s). I see it Sergio Durigan Junior's way. If I'm writing , then the text of contains #include #include #include And the text of contains no #includes. But if I'm writing a *.h file that has size_t parameters in the function prototype declarations, then *.h will have #include and *.c will have #include "*.h" -- pete