Loading I2C data into array

I am trying to use an ADXL345 to measure vibration, utilizing I2C and ADXL libraries along with SimpleTimer. I've verified that the ADXL345 is working properly, reading only the Z axis. My goal was to read every 50 milliseconds and input into an array that would hold the vibration waveform.

This code does NOT work;

AZ[k] = accel.getAccelerationZ(); k = k + 1;

Is there a way to store readings in an array?

Also, any way to search these forums for similar questions?

Thanks.

This code does NOT work;

For what definition of work? If AZ is the same type as the value returned by accel.getAccelerationZ(), and k is within the bounds of the array, the the code DOES work, and your problem is elsewhere.

PaulS:
If AZ is the same type as the value returned by accel.getAccelerationZ(), and k is within the bounds of the array, the the code DOES work, and your problem is elsewhere.

@OP

Referring to the above quote, we would like to see the full syntactical declaration of the variable AZ[k]. Tell us the data type (char, int, byte or float) for the items of the array AZ and also the data type of the value returned by the method accel.getAccelerationZ();.