Next:
Structure of a C++
Up:
Human-side C++ syntax
Previous:
Indentation
Contents
Comments
Not necessary for the computer
Absolutely necessary for the programmer / maintainer
One-line comments: introduced by
//
Multi-line comments:
/*
...
*/
Avoid over- and under-commentation
Example of over-commentation
// assign 0 to x
double x = 0;
Example of under-commentation
char buffer[] = "01011010 01100100";
char* bufPtr = buffer;
while(*bufPtr &&
(*bufPtr++ = *bufPtr == '0' ? 'F' : 'T'));
Leo Liberti 2008-01-12