Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!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: Tue, 27 Nov 2012 23:13:54 -0600 Message-ID: <50B59D91.5137@mindspring.com> Date: Wed, 28 Nov 2012 00:13:53 -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> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Lines: 36 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.220.227 X-Trace: sv3-D21uX0sH0e1IfYiQSZBqNc63tmCOLzGAvm6Q9Ru6MFaVJh3wMfCXurGk2Go2I3ZEBCMG3ljxuambggG!K/CNRJe42g33MAOlW2fS/1a3WxjDq8okZ57M1G+clBLG0JQFEuMNbo+KuY3Z6V7aopFVc62ssO6d!5ewF+e7phko= 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: 1960 Xref: csiph.com comp.lang.c:28717 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é I use main.h for two things: 1 declarations and definitions for main.c 2 declarations and definitions for each.h Both or either of those things can be optional, depending on how the program is written; which is to say that there may or may not be a main.h An example is here: http://www.mindspring.com/~pfilandr/C/e_driver/ e_driver is a program in 6 files. e_driver.h has typedefs, which all of the files use. e_driver.h is #included in e_driver.c, e_sort.h, and also in e_distributions.h Here is a different example: http://www.mindspring.com/~pfilandr/C/library/ libray is a program in 12 files. There is a library.c, but there is no library.h -- pete