title: Pass by reference with template functions C++
body: <p>I'm Trying to make a template function and pass two variables to it by reference , every thing sounds good but it never compiled and the error message is :-</p>
  
  <pre><code>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  </code></pre>
  
  <p>I tried a small part of code and it gives me same error, any help please??</p>
  
  <p>And this a part of code, the all other code is just like this:</p>
  
  <pre><code>int size , found = -1 ; 
  
  template&lt;class type&gt; Read_Data( type &amp;key , type &amp;arr)
  { 
      cout &lt;&lt; " please enter the size of your set \n " ; 
      cin &gt;&gt; size ;
      arr = new type[size]; 
  
      cout &lt;&lt; " please enter the elements of your set : \n " ;
      for (int i = 0 ; i &lt;size ; i ++ )
      {
          cout &lt;&lt; " enter element number " &lt;&lt; i &lt;&lt; ": "  ;  
          cin &gt;&gt; arr[i] ;
      }
      cout &lt;&lt; " please enter the key elemente you want to search for : \n " ;
      cin &gt;&gt; key ; 
  }
  
  void main(void)
  { 
      int key , arr ; 
      Read_Data (key, arr);
  
      /*after these function there is two other functions one to search for key 
      in array "arr" and other to print the key on the screen */ 
  }
  </code></pre>