C/C++ Programming Style Guidelines



.h
files everywhere they are required.
2.1. Header (Interface) File Content
Header files should contain the following items in the given order.
1. Copyright statement comment
2. Module abstract comment
3. Revision-string comment
4. Multiple inclusion
#ifdef
(a.k.a. "include guard")
5. Other preprocessor directives,
#include
and
#define
6. C/C++
#ifdef
7. Data type definitions (classes and structures)
8.
typedef
s
9. Function declarations
10. C/C++
#endif
11. Multiple inclusion
#endif
Example 1. Standard (C) header file layout
/*
* Copyright (c) 1999 Fred C. Richards.
* All rights reserved.
*
* Module for computing basic statistical measures on
* an array of real values.
*
* $Id$
*/