Hi

I have code

```
int distance = 400;
int avg_distance = 200;
int *avg_tmp[10] = {300, 200, 200, 200, 200, 200, 200, 200, 200, 200};
int avg_counter = 0;
int tmp_sum = 0;
void loop() {
avg_distance[avg_counter] = 3; //distance;
if ( avg_counter == 9 )
avg_counter = 0;
else
avg_counter++;
for ( int i = 0; i < 10; i++)
tmp_sum += avg_distance[i];
}
```

why I’m making such a mistake :

*error: invalid types ‘int[int]’ for array subscript*

- avg_distance[avg_counter] = 3; //distance;*

and

*error: invalid types ‘int[int]’ for array subscript*

- tmp_sum += &avg_distance[3];*

how to correct it ?

Thanks.