Re: Headers ????



Robby <Robby@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Is it customary or typical to declare all function prototypes in one
header as opposed to creating a header file for every .c file and
declaring the function prototypes in the respective .h header file?

I've seen it either way. And a third way in between, where there are
multiple headers, each corresponding to some logical unit of the library
(e.g. a source file), plus a master header that simply #includes all of
them. The client then just has to include the master header to get
access to the whole library. See e.g. windows.h

I mean, right now, for every .c file, I have a .h file where I define
the functions that exist in the .c file . I find this redundant of
having so many .h files. Can't I just have one .h file and define all
the .c functions in there?

Yes you can.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: I have a centering Problem on excel documents.
    ... >>When printed it appears as if some one printed a Master header on just ... > exactly one header and footer - anything else requires VBA. ... I dad is in early stage althiemers and its difficult to convince him ... either to take his medication and eye drops; ...
    (microsoft.public.mac.office.excel)
  • Re: I have a centering Problem on excel documents.
    ... >>Page then other pages do not have any header information. ... >>there is a Master Header setting somewhere. ... and footer to zero in Document setup. ...
    (microsoft.public.mac.office.excel)
  • Re: I have a centering Problem on excel documents.
    ... > Page then other pages do not have any header information. ... > there is a Master Header setting somewhere. ... > I've even tried setting Header, and footer to zero in Document setup. ...
    (microsoft.public.mac.office.excel)
  • Re: header files & #includes
    ... In most environments, the headers can be included in any order, and ... there is no advantage to including them all in one "master header." ... significant advantage to including headers in the same order within each ... the "master header" approach can be ...
    (comp.lang.cpp)
  • Re: Question about public and public static
    ... property or class that is associated with a particular type but which does not require access to the instance members of the type. ... Suppose I am writing a general utility 'class' that does not need access to instance members because each function is self contained. ... I could achieve this in C++ by declaring the methods outside of a class in the header and then include the appropriate header in the source file. ...
    (microsoft.public.dotnet.languages.csharp)