Compile error

This doesn't compile pls help..//

#include<iostream>
using namespace std;
void fillarray(int a[],int size)
{
int element;
for (int i=0;i<size;i++)
{
cout<<"Enter integers to fill array"<<endl;
cin>>element;
a[i]=element;
}
}
void displayarray(int a[],int size)
{
double total =0.0;
double average;
cout<<endl<<endl;
cout<<"The Content of the array";
for(int i=0;i<size;i++)
cout<<a[i]<<" ";

for(int j=0;j<size;j++)
total=(double)(total+a[j]);
cout<<endl;
cout<<"The Total of the array element"<<total<<endl;
average=total/size;
cout<<"The average of array elements"<<average<<endl;
}

int main()
{
int size;
cout<<"Enter the size of the array"<<endl;
cin>>size;
fillarray();
displayarray();

}
you need to pass an array to fillarray() and displayarray()
maybe it is fillarray and diplayarray
Topic archived. No new replies allowed.