C/C++ Programming Style Guidelines



#define STATISTICS_H
#include <math.h>
#include <values.h>
#define MAXCOMPLEX { MAXINT, MAXINT }
#ifdef _cplusplus
extern "C" {
#endif
struct complex {
int r; /* real part */
int i; /* imaginary part */
};
typedef struct complex Complex;
...
/*
* Compute the average of a given set.
*
Input - array of real values, array length.
*
Output - average, 0 for empty array.
*/
float
ave(float* v, unsigned long length);
...
#ifdef _cplusplus
}
#endif
#endif /* STATUS_H */