pdf.css
Google


   


You are here: CodeIdol > C++ > C/C++ Programming Style Guidelines > page: 4 5 6 7 8 9 10 11 12 13 14


error("The value is too big.");
}
Although the brackets may seem tedious for one-line blocks, they greatly reduce the
probability of errors being introduced when the block is expanded later in the code's
life.

3.1. Unique to C++
Start
public
,
protected
,
private
, and
friend
labels in column zero of class
declarations. Use explicit
public
labels for all
struct
public fields and use explicit
private
labels for all private class members.
The members of a class should be declared in the following order. Declare all public
data members and type definitions first. Declare private or protected data members or
type definitions used in function member initialization lists or inline implementations
next. Declare all public member functions next, starting with the constructors and
destructor. Declare all remaining private or protected data members and type definitions
next. Declare all private or protected function members next. Declare all friends last.

Put simple inline function definitions on the same line as their declaration. For inline
functions spanning multiple lines, use a pure-block style with four-space indentation.
In general, avoid putting complex function implementations

.h
files.
Example 6. Class declaration format
class Type : public Parent {
private:
int x_;
int y_;
public:
Type();
Type(int x) : x_(x) { }
~Type();
You are here: CodeIdol > C++ > C/C++ Programming Style Guidelines > page: 4 5 6 7 8 9 10 11 12 13 14


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