Array-wise operations

Bob Cowdery bob at
Tue Oct 12 12:20:47 PDT 2010

 I'm trying to implement some array-wise operations.

// I have an array of float values that need to be averaged over a 10
cycle period.
float x_points[600];
float x_average[600][10];
int ptr = 0;

// I accumulate one cycle in x_points and add that into a circular array
of the last 10 cycles
x_average[ptr] = x_points;
if (++ptr > 9) {ptr = 0;}
// Now I want to average the last 10 cycles and put the result back into

The average gives me a compile error of incompatible types.


More information about the Digitalmars-d-learn mailing list