You're also computing the mean incorrectly. You're computing the mean while the sum is still zero.
It's probably better if you change the return type of the "mean" function to 'int', instead of having it as 'void'. Then put 'return mea;' at the end of the "mean" function.
1 2 3 4 5 6 7
int mean(int * arr1, int arraySize){
//....
//....
return mea;
})
somewhere in your main, use this
1 2
cout << mean(arr1, arraySize);
I would like to point out that you shouldn't have the same variable names when you declared it in main() and for mean(). That's really bad programming practice. Your code will still compile but readability of your code requires people to be very conscious of the scope of variable names.