title: C++ -- need help figuring out a while loop issue
body: <p>So, need some direction on why this loop is loopin' forever. What I want it do is read a new m, which then sets the terms for the for loops. So, it reads m, which then is calculated into an array, and then reads a new m, etc. Currently it reads one m and does the for loops forever. </p>
  
  <pre><code>while(inputFile &gt;&gt; m) {
    while (m != 0) { 
      cout &lt;&lt; "m=" &lt;&lt; m &lt;&lt; endl;
      for (i=0; i &lt; (m*m); i++) { 
        cout &lt;&lt; "m times m = " &lt;&lt; (m*m) &lt;&lt; endl;
        for (ROW=0; ROW &lt; m; ROW++) {
          inputFile &gt;&gt; image[ROW][COL];
          cout &lt;&lt; "array= " &lt;&lt; image[ROW][COL] &lt;&lt; endl;
            for (COL=0; COL &lt; m; COL++) {
              inputFile &gt;&gt; image[ROW][COL];
              cout &lt;&lt; "array= " &lt;&lt; imagee[ROW][COL] &lt;&lt; endl;
            }
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>Sample of input file:</p>
  
  <pre><code>3
  1 2 3
  4 5 6
  7 8 9
  </code></pre>