title: C syntax error : missing ';' before 'type'
body: <p>I'm getting a very strange syntax error in a C project I'm doing in Microsoft Visual C++ 2010 Express. I have the following code:</p>
  
  <pre><code>void LoadValues(char *s, Matrix *m){
      m-&gt;columns = numColumns(s);
      m-&gt;rows = numRows(s);
      m-&gt;data = (double*)malloc(sizeof(double) * (m-&gt;rows * m-&gt;columns));
      int counter = 0;
      double temp;
      bool decimal;
      int numDec;
      while(*s != '\0'){
          .
          .
          .
      }
  }
  </code></pre>
  
  <p>When I try to Build Solution, I get the "missing ';' before type" error for all of my variables (temp, counter, etc), and trying to use any of them in the while loop causes an "undeclared identifier" error. I made sure bool was defined by doing</p>
  
  <pre><code>#ifndef bool
      #define bool char
      #define false ((bool)0)
      #define true ((bool)1)
  #endif
  </code></pre>
  
  <p>at the top of the .c file. I've searched Stack Overflow for answers and someone said that old C compilers don't let you declare and initialize variables in the same block, but I don't think that is the problem, because when I comment out the lines</p>
  
  <pre><code>m-&gt;columns = numColumns(s);
  m-&gt;rows = numRows(s);
  m-&gt;data = (double*)malloc(sizeof(double) * (m-&gt;rows * m-&gt;columns));
  </code></pre>
  
  <p>all of the syntax errors go away and I have no idea why. Any help is appreciated.</p>
  
  <p>---EDIT----
  The code for Matrix was requested</p>
  
  <pre><code>typedef struct {
      int rows;
      int columns;
      double *data;
  }Matrix;
  </code></pre>