Error for finding the highest value in a array

I don't know what i did wrong to find the highest value after typing in the value for 12 months

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

#include <iostream>
#include <iomanip>

using namespace std;
int main ()
{
int const SIZE= 12;
	double rainfall[SIZE];
	double totalrainfall= 0;
	double avg_rainfall= totalrainfall / 3;

	for(int x=0; x<SIZE; x++)
	{
		cout<<"Type amount of rainfall for each 12 months "<<x+1<<endl;
		cin>>rainfall[SIZE];
		totalrainfall+= rainfall[SIZE];
	}

	int a;
	int highest;
	highest = SIZE[0];
	for (a= 1; a <SIZE; a++)
	{
		if(SIZE[a]>highest)
			highest = SIZE[a];
	}
	
First of all in line 11 you divide 0 by 3 what for?
And next I see SIZE everywhere what for?
So that i can find what highest value since the value is being inputted into SIZE that has 12 elements so im trying to figure out using the for loop to check and find the highest value by comparing the values in the elements.
But im getting an error in line 22 highlighting 0 saying expression must have object to pointer type
Topic archived. No new replies allowed.