Header files included in header files

From: John Smith (soneone_at_microsoft.com)
Date: 07/21/04


Date: Wed, 21 Jul 2004 08:39:28 +0100

Hi all

What does the group think of the practise of including one header file from
inside another?

I have some legacy code where this has been done, and it creates a
dependency on a module (collection of files) which are not required, except
for one header file's contents.

I'd say 'No, header files should be included in the C source, not in another
header', but I've always come across strong arguments for the latter.

What do you think, and what is accepted practise?

Thanks
JS



Relevant Pages

  • Re: Header files included in header files
    ... > What does the group think of the practise of including one header file ... > I have some legacy code where this has been done, ... > dependency on a module which are not required, ...
    (comp.lang.c)
  • Re: Header files included in header files
    ... > What does the group think of the practise of including one header file from ... way that the single line source file ... Note that a function can have arguments or return values of type "struct ...
    (comp.lang.c)
  • Managed C++ & P/Invoke in a web serice
    ... I am exploring using P/Invoke to call some legacy code from our customer ... Header file of C++ class for web service: ... Class file for web service: ...
    (microsoft.public.dotnet.languages.vc)