THE ZEPINT NETWORK

programmer assist

C++ C++ XML Feeds

C++ Questions C++ Solutions C++ Articles

C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for creating large-scale applications. C++ is a superset of the C language. A related programming language, Java, is based on C++ but optimized for the distribution of program objects in a network such as the Internet. Java is somewhat simpler and easier to learn than C++ and has characteristics that give it other advantages over C++. However, both languages require a considerable amount of study.

A Coding Convention for C++ Code

DiggBlinkRedditDeliciousTechnorati

article by Support@PA

Source: http://www.cs.rice.edu/~dwallach/CPlusPlusStyle.html

Purpose
------------------------------
To make it easier for us to read each other's code, here are a few guidelines to follow when writing C++ code.
Definitions

* Member functions are functions that are associated with classes.
* Data members are variables that are part of classes.

Identifier Names
------------------------------
* All variable and constant identifiers begin with a lowercase letter.
* Global variables begin with the (for example, theWindows).
* Constants begin with lowercase c (for example, cMaxWindows).
* Class data members begin with its (for example, itsCanvas).
* Static data members begin with their (for example, theirTotal).
* Both member and non-member functions begin with an uppercase letter (for example, TextStyle).
* Names of classes begin with an uppercase letter (for example, Canvas).

Class Declarations
------------------------------
Classes are declared in the following order: public member functions, protected member functions, private member functions, protected data members, and private data members. No data members may be declared public. For example:

class Application {
public:
Application();
~Application();
void Run();
protected:
void EventLoop();
private:
EventRecord itsLastMouseEvent;
}

Control Structures
------------------------------
The control structures are as follows:

if (expression) {
statements;
} else {
statements;
}

for (expression; expression; expression) {
statements;
}

do {
statements;
} while (expression);

while (expression) {
statements;
}

switch (expression) {
case constant:
statements;
break;
default:
statements;
break;
}

/*
* long comments which need more than one line use
* this block comment style, if you're writing C
*/

//
// if you're writing C++, your block comments should look more
// like this -- it's ugly to mix commenting styles
//

statement; /* short C comments */
statement; // short C++ comments

File Names
------------------------------
C++ source files use the suffix .cc. C++ header files use the suffix .h.

Got a C++ Question?

Just Sign Up and ask the top C++ experts!

Search via Google

User Login

Email Address

Password

C++ Experts

Rank Expert Points
#1 Support@PA 500
This a list of the Top C++ experts, how many points do you have?

Leading Experts

Rank Expert Points
#1 frankzzsword 4600
#2 Bejaan 2900
#3 csfreak 1100
#4 Anurag 700
#5 keyvez 700
#6 nnarasimha 600
#7 Nakata 600
#8 martinig 600
#9 mastercomputers 400
#10 Huntress 150
#11 Adkron 150
#12 Yogesh 100
#13 lexxwern 100
#14 Mustan Khan 100
#15 poizn 100
This is a list of overall best performing experts, how many points do you have?