pdf.css
Google


   


You are here: CodeIdol > C++ > C/C++ Programming Style Guidelines > page: 1 2 3 4 5 6 7 8 9 10 11


C and C++ code files follow a similar structure to the header files. These files should
contain the following information in the given order.

1. Copyright statement comment
2. Module abstract comment
3. Preprocessor directives,
#include
and
#define
4. Revision-string variable
5. Other module-specific variable definitions
6. Local function interface prototypes
7. Class/function definitions
Unlike in the header file, the implementation-file revision string should be stored as a
program variable rather than in a comment. This way ident will be able to identify the
source version from the compiled object file. For C files use:

static const char rcs_id[] __attribute__ ((unused)) =
"$Id$";
The
__attribute__
modifier is a GNU C feature that keeps the compiler from
complaining about the unused variable. This may be omitted for non-GNU projects.
For C++ files, use the following form for the revision string:

namespace { const char rcs_id[] = "$Id$"; }
Precede each function or class method implementation with a form-feed character
(Ctrl-L) so that when printed the function starts at the start of a new page.

You are here: CodeIdol > C++ > C/C++ Programming Style Guidelines > page: 1 2 3 4 5 6 7 8 9 10 11


ADBRITE ads links
   
Related tags







Popular Categories
Unix books and guides

AJAX popular information
C# language guides
Windows books and cookbooks

.......








Business Key Top Sites

be number one
rate your site




    С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.

    Русский Polski Francais Deutsch
    support sitemap terms

© CodeIdol Labs, 2007 - 2009