double sumArray(double u[])
{
double summ=0.0
for(int i=0; i<sizeof(u)/sizeof(u[0]); i++)
{
summ=summ+u[i];
}
return summ;
}
int main(){
cout<<"how big is your array";
int Uarraysize;
cin>>Uarraysize;
double Uarray[Uarraysize];
for(int i=0;i<Uarraysize;i++){
cin>>Uarray[i];
}
double summ=sumArray(Uarray);
cout<<summ;
return 0;
} I am trying to get the size of the parameters of the array u for my for loop in my double sumarray function but it is being read as a double* which equals 8 instead of being read as size*8. Hoping to find out why and how to fix it