title: Using #define in C Program
body: <p>I am trying to use <code>#define</code> to define a constant in my program. I realize I could use <code>const</code>, but I am trying to get a good understanding of <code>#define</code>. Could someone please explain why the following code does not work, and should be done instead?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define M 20;
  typedef int Marray_t[M][M]; //I can't define an M x M array
  
  int main() {
    Marray_t A;
    int i;
  
    for (i = 0; i &lt; M; ++i) { //Can't iterate up to M
      A[i] = i;
    }
  
    return 0;
  }
  </code></pre>