### Expression Must have Constant Value??

line 27 and line 88 Im having a hard time figuring it out what the error is.
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100`` ``````#include #include #include using namespace std; //Prototypes double Mean (int [], int); double standardDeviation (int [], int, double); int main() //Main Function { int n; double avg = 0; double median = 0; double median2 = 0; double sD; int min=0; int max = 0; cout<<"How many numbers do you want to use? "; //Gets the size of the array cin>>n; int *ar = new int[n]; int tempAr[n]; cout<>ar[i]; tempAr[i] = ar[i]; //a temp array } sort (tempAr, tempAr+n);//Sort into ascending order min=tempAr[0]; //Traverses through the array and finds the smallest number max=tempAr[n -1]; //Traverses through the array and finds the largest number cout<<"\tThe smallest number is: "<
Last edited on
On line 26, you try to declare a static array of size n, which isn't a constant value.
Same issue on line 87.
To do that, you'd have to use dynamic allocation like you did on line 25.
From Line 1 through 25 my instructor gave us the code from there on we would have to finish the program ourselves .

For line 88 would i copy line 25 and paste it above line 88?

I havent been to class in about 9 days lol and Im currently lost. Can you guide me with further assistance
Topic archived. No new replies allowed.