title: Why programm does not work?
body: <p>created a template class for the array. Then I created constructors and destructors, overloaded the input and output operators.</p>
  
  <pre><code>using std::istream;
  using std::ostream;
  
  template &lt;typename T&gt; class myArray;
  template&lt; typename T&gt; ostream&amp; operator &lt;&lt;(ostream &amp;, const myArray &lt;T&gt; &amp;);
  template&lt; typename T&gt; istream&amp; operator &gt;&gt; (istream &amp;, const myArray&lt;T&gt; &amp;);
  
  template &lt;typename T&gt; class myArray
  {
  private:
  T**mas; 
  int line, 
      column;
  friend istream&amp; operator &gt;&gt; &lt;T&gt;(istream &amp;, const myArray &amp;);
  friend ostream&amp; operator &lt;&lt; &lt;T&gt;(ostream &amp;, const myArray &amp;);
  
  public:
  myArray() : mas (0), line ( 0) column (0) {} 
  myArray(int n, int m);
  myArray(const myArray &amp;masToCopy);
  ~myArray() 
  {
      for (int i = 0; i&lt;line; i++)
      {
          delete[](mas[i]);
      }
      delete[](mas);
  }
  };
   template &lt;typename T&gt; myArray &lt;T&gt;::myArray(int n ,int m ) 
  {
  mas = new T*[n];
  for (int i = 0; i &lt; n; i++)
  {
      mas[i] = new T[m];
  }
  }
  template &lt;typename T&gt; myArray &lt;T&gt;:: myArray(const myArray &amp;masToCopy)
  {
  line = masToCopy.line;
  column = masToCopy.column;
  
  mas = new T*[line];  
  for (int i = 0; i &lt;line; i++)
      mas[i] = new T[column];
  
  for (int i = 0; i&lt;line; i++)
      for (int j = 0; j &lt; column; j++)
          mas[i][j] = masToCopy.mas[i][j];
  }
  
  template&lt; typename T&gt; istream&amp; operator &gt;&gt; (istream &amp;in, const myArray&lt;T&gt; &amp;el) 
  {
  for (int i = 0; i &lt; el.line; i++)
  {
      for (int j = 0; j &lt; el.column; j++)
      {
          in &gt;&gt; el.mas[i][j];
  
      }
  }
  return in;
  }
  
  template&lt; typename T&gt; ostream&amp; operator &lt;&lt; (ostream &amp;out, const myArray&lt;T&gt; &amp;el) 
  {
  for (int i = 0; i &lt; el.line; i++)
  {
      cout &lt;&lt; "\n";
      for (int j = 0; j &lt; el.column; j++)
      {
          out &lt;&lt; el.mas[i][j];
          cout &lt;&lt; " ";
      }
  }
  return out;
  }
  </code></pre>
  
  <p>When I try to use my class the program does not allow to enter an array and then does not show it. Instead it mmediately writes "To continue, press any key"</p>
  
  <pre><code>using std:: cin;
  using std::cout;
  
  int main()
  {
  myArray&lt;int&gt; intArray1(2,2);
  cin &gt;&gt; intArray1;
  cout &lt;&lt; intArray1;
  return 0;
  }
  </code></pre>
  
  <p>How can I fix this?</p>