title: Using a macro in call to malloc
body: <p>I'm just a bit stuck as to why this doesn't work. Am I missing something obvious? This is what I am trying to do:</p>
  
  <pre><code>#define LENGTH 4;
  new-&gt;array = malloc(sizeof(int)*LENGTH);
  </code></pre>
  
  <p>I'm using Xcode and getting errors for 'expected ")"' at the start of LENGTH and 'expected expression' at the end of LENGTH.</p>
  
  <p>But this is ok:</p>
  
  <pre><code>int size = sizeof(int)*LENGTH;
  new-&gt;array = malloc(size);
  </code></pre>
  
  <p>What is the reason why I cannot do the first one?</p>