Re: Headers ????




"Robby" <Robby@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:ED3B96A1-64C0-4906-86ED-28C9F8DC3AF4@xxxxxxxxxxxxxxxx
Hello,

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 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?

Just wondering and all feedback is appreciated!

In general I would try to limit dependencies as much
as possible. If you put all of your declarations in one header, then
you need to expose all declarations to any source that needs
even one.
If you do this and you change any one of the declarations,
you will have to recompile all of the source files using them.

What benefit do you expect from combining all of them?

.



Relevant Pages

  • Re: Headers ????
    ... I am thinking of combining them all in one header file and seperating them ... Is it customary or typical to declare all function prototypes in one ... If you put all of your declarations in one header, ... you will have to recompile all of the source files using them. ...
    (microsoft.public.vc.language)
  • Re: header file (main.cpp)
    ... While a common practice, it's not mandatory. ... You usually put declarations in .h file, ... declaration for it in a header file. ... If it contains functions that other source files might need to call, ...
    (microsoft.public.vc.language)
  • HIDE 1.0.7 now available for HLA
    ... which uses the wscan.exe program to extract windows constants and external declarations from the w.hhf header file to create a more compact version to include in programs. ... This is an early experimental version which requires some manual work to get all the symbols referenced indireclty through the windows header file. ... -option to auto-complete common HLA structure keywords -1 click/key jump to declarations -debug mode and debug window to display output. ...
    (alt.lang.asm)
  • Re: why still use C?
    ... >> of comments, preprocessor directives, typedefs, and function prototypes. ... > any use of them in a header file context dangerous. ...
    (comp.lang.c)
  • Re: Function prototypes
    ... Hi, I'm currently taking a data structures course in C, and my teacher ... also said that no professional programmers use function prototypes. ... prototypes in the header file, my compiler would assume the function ...
    (comp.lang.c)

Quantcast