C/C++ Programming Style Guidelines



/*
* Compute the DC offset of the given signal.
*/
float
dc_offset(const short * const signal,
const unsigned long length);
/*
* Poll the D/A and return the current gain setting.
*/
float
gain(void);
In general, be consistent and be informative. Choose names that make your code easy
to read and understand.

4.3. Classes, Structures and Type Definitions
The name formatting conventions described here are essentially those used by
Stroustrup in his book on C++.

Capitalize the first letter of the name of each data type that you define. This includes all
struct
,
class
,
typedef
and
enum
types. Use an underscore as a word separator, just
as for C variables and function names.
For class instance variables, start all names with lower-case letters. Again, use an
underscore as a word separator. Apply the same rules to

public
and
protected
members, both variables and functions. Add a trailing underscore to
private
member
names.