title: How to write a template function that takes an array and an int specifying array size
body: <p>For a university exercise, I  have been asked to write a template function "print();", which takes two arguments, 1: an array of a generic type, and 2: an int specifying the size of the array. The function should then print out every item in the array to the console. I am having some trouble with the function arguments. The code I currently have is:</p>
  
  <pre><code>   template &lt;typename Type&gt;
     Type print (Type a, Type b)
      {
          Type items;
          Type array;
          a = array;
          b = items;
  
          for (int i = 0; i &lt; items; i++) {
          std::cout &lt;&lt; std::endl &lt;&lt; "The element of the index " &lt;&lt; i &lt;&lt; " is " &lt;&lt; array &lt;&lt; std::endl;
          std::cout &lt;&lt; std::endl;
      }
  </code></pre>
  
  <p>and in main():</p>
  
  <pre><code>    print(Array[], 10);
  </code></pre>
  
  <p>Obviously putting Array as an argument isn't returning a value, so I am not sure what else to do. Any ideas?</p>