Function error SORTED NOW!

Based on your previous help I managed to get my first function behaving well.

Then I added a second one and I don’t understand the error message as I think I used a very similar structure to the first one.

//set up the global variables
const int numReadings =10;
const int numPorts =2;
long numberofReadings=numReadings;
int readings[numReadings][numPorts];      // the readings from the analog input ports
int readIndex=0;                          // the index of the current reading row
float total[numPorts];                    // the running totals for each port
float average[numPorts];                  // the average for each port
void InitArray (void);
void GetNewAverage (void);

void setup() {
  // initialize serial:
  InitArray(); //call function to pre-fill the arrays 

void loop() {
  Serial.print ("Total(0)= ");
  Serial.print (total[0]);
  Serial.print ("  ");
  Serial.print ("Temp(0)= ");
  Serial.println (average[0]);
  Serial.print ("Total(1)= ");
  Serial.print (total[1]);
  Serial.print ("  ");
  Serial.print ("Temp(1)= ");
  Serial.println (average[1]);
void InitArray(){
  // initialize all the readings to an initial read value from each port
  for (int j=0; j< numPorts; j++){
    int initReading=analogRead(j);
    for (int i = 0; i < numReadings; i++) readings[i][j] = initReading;
void GetNewAverage (){
  for(int j=0; j<numPorts; j++){
    readings[readIndex][j] = analogRead[j];
    total[j]=total[j] + readings[readIndex][j];
  readIndex=readIndex + 1;
  if(readIndex >= numReadings){
  for (int j=0;j<numPorts;j++){


Func10_2_dimensional_array.ino: In function ‘void GetNewAverage()’:
Func10_2_dimensional_array:47: error: pointer to a function used in arithmetic
Func10_2_dimensional_array:47: error: invalid conversion from ‘int (*)(uint8_t)’ to ‘int’

Guidance welcome


Sorry if I wasted anybodys time. I just looked back at the code and the problem became obvious but I can't delete the original post.