title: Printing the elements of an array passed to a function?
body: <p>Sorry if I'm asking a question that's already answered somewhere, but I am trying to work out how to write a function that firstly gets passed an array, then prints the elements of the array just passed to it.</p>
  <pre><code>void print_array(float stdarray[], int array_size)
  {
      int i ;
  
      for (i = 0 ; i &lt; array_size ; i++) {
          printf(&quot;%f\n&quot;, stdarray[i]) ;
      }
  }
  </code></pre>
  <p>This was the chunk given to us, and this was the little exercise:</p>
  <p>Modify the previous program to use the print_array function above for printing the
  elements of the array passed to it (Tip: To pass an array as input in a function call, just
  specify the array name without the square brackets [ ] ). That is, replace the purple
  section of code with a call to the print_array function.</p>
  <p>This isn't a graded question or marked, it's just an extra brain teaser my university is getting me to do, so I assure you I'm not cheating! I'm a little bit out of practice since I was on holidays, so if anyone could help that'd be great!</p>
  <p>Edit: Apologies for the purple section, but I am not sure what they mean either, as it's in a black and white textbook section :). I appreciate the help.</p>
  <p>There is another text of code above this that prints out an array's element, but if that isn't the main text then I'm not sure what is.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #define N 5
  
  int main(void) 
  {
      float numbers[N] ;
      int i ;
  
      for (i = 0 ; i &lt; N ; i++) {
          printf(&quot;Enter number: &quot;) ;
          scanf(&quot;%f&quot;, &amp;numbers[i]) ;
      }
      for (i = (N - 1) ; i &gt;= 0 ; i--){
          printf(&quot;%f\n&quot;, numbers[i]) ;
      }
  
      return(0) ;
  }
  </code></pre>