I have quite a big problem!
I have to make an array in one function (NOT MAIN!!!) that does not return the array, but just the average value of its elements to main.
Then, I have to use elements from the same array to calculate other values form them (can also be in main).
Is that possible at all?
How can I reach array from function f (not main) if the function f is not returning array?
int main()
{
int sum = 0;
int average = 0;
int array[10] = {1,2,3,4,5,6,7,8,9,10};
for (int i = 0; i < 10; ++i)
sum+=array[i];
average = sum/10;
cout<<"Average:"<<average;
}
Hello!
What is happening with DataSet[10] in main?
I ment, I have array declared and INITIALISED in function, then I want to translate the whole (full!) aray into main, with all the elemnts values, like in function...
or at least, to call elemets from array in function in main...
I can do the opposite (call elements from main-array in the function.