title: Array's in function confusion C++
body: <p>I need to write a program that is passed an array of int and its size, and with that it prints out the numbers that are above average. Can anyone help clear this question up for me? I am sitting here wondering what the heck it is asking, and I am still quite new to programming so i don't know what to do. Sorry I sound so unable, but I am just confused. Thank you to anybody who can help. This is all I have so far: </p>
  
  <p>Here is the updated code, but I still can't figure out why there aren't multiple average values displaying out, or how to get the output value to be correct.<br>
  EDIT: Changed a couple int values in the average() function to floats, but there is still a problem with the total value's at the end</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int average(int values[],int size);
  
  int main(){
  int size;
  int values[] = {1,2,3,4,5,6};
  cout &lt;&lt; "Please input the size of the array" &lt;&lt; endl;
  cin &gt;&gt; size;
  int output = average(values, size);
  if(values[size]&gt;output){
      cout &lt;&lt; "The values above average are: " &lt;&lt; output &lt;&lt; endl;
  }
  
  return 0;
  }
  
  int average(int values[],int size){
  float temp=0.0;
  for(int i=0;i&lt;size;i++){
      temp += values[i];
  }
  float end=temp/size;
  
  return end;
  }
  </code></pre>