title: C++ 2D array to 1D array
body: <p>I am attempting to convert a 2D array to 1D.
  I'm extremely new to C/C++ but I think it's very important to learn how to convert a 2D array to 1D. 
  So here I am stumbling upon this problem.</p>
  
  <p>My code so far is 
      <a href="http://ideone.com/zvjKwP" rel="noreferrer">http://ideone.com/zvjKwP</a></p>
  
  <pre><code>#include&lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
  
  int n=0,m=0; // 2D array nRow, nCol
  int a[n][m];
  int i,j; // цикъл въвеждане 2D
  int q,p,t; // for 2D=&gt;1D
  int b[100];
  int r; // for cout
  cout&lt;&lt;"Enter the array's number of rows and columns: ";
  cin&gt;&gt;n&gt;&gt;m;
  
  // entering values for the 2D array
      for (i = 0;i&lt;=n;i++)
      {
          for (j = 0;j&lt;=m;j++)
          {
              cout&lt;&lt;"a["&lt;&lt;i&lt;&lt;"]["&lt;&lt;j&lt;&lt;"]="&lt;&lt;endl;
              cin&gt;&gt;a[i][j];
              cin.ignore();
          }
      }
  
    // Most likely the failzone IMO
    for (q = 0;q&lt;=i;q++)
      {
          for (t = 0;t&lt;=i*j+j;t++)
          {
              b[t] = a[i][j];
          }
      }
      // attempting to print the 1D values
       cout&lt;&lt;"The values in the array are"&lt;&lt;"\n";
      for(r=0;r&lt;=t;r++)
      {
          cout&lt;&lt;"b["&lt;&lt;r&lt;&lt;"] = "&lt;&lt;b[r]&lt;&lt;endl;
      }
  
      cin.get();
      return 0;
      }
  </code></pre>
  
  <p>I wrote a comment at where I think I fail. </p>
  
  <p>I must also limit the numbers that get into the 1D to numbers who's value^2 is greater than 50.
  But for sure I must solve the problem with the conversion 2D=>1D
  Can you help me out?</p>