Re: Ahead of "main"?



Barry Schwarz wrote:
You should not put any function definitions in a header file. I would
go a step further and say no object definitions either. Only
declarations. The only definitions in a header file should be typedef
(oops, even though it is called a type definition in the standard, it
is specifically described as a declaration)

All definitions are also declarations (macro definitions don't count
as "definitions"). A type definition is both a declaration and a
definition. A definition of an enumeration constant is also a
definition that can be appropriate for header files.

and macro definitions.

.



Relevant Pages

  • 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: Header files question
    ... keyword) in a header file which you include where needed. ... So Nils, what you are saying? ... Declarations in the header file? ... You have a fundamental misapprehension in your usage of header ...
    (comp.lang.c)
  • Re: <Help> Simple Pause Needed.
    ... In a 'real' program you might put the declarations ... in a header file ... copy-paste is a nice easy way to do the forward declaration. ... Let's see (from Borland online help): ...
    (comp.lang.cpp)
  • Re: Suppose: All code in header files?
    ... > in the source file not in the header file. ... the only includes that should be in a header file are those ... If you're making declarations or function prototypes in your implementation ... The purpose of the header file is to declare the interface to the ...
    (comp.lang.cpp)
  • Re: variable changes value spontaneously
    ... > variables were also declared (not as arrays) in the header file. ... Variables in COMMON match up ... Post some of the declarations from the header file and someone may ...
    (comp.lang.fortran)