 <p>When you allocate memory with <code>malloc</code> (or similar functions) it returns a <em>pointer</em>. You can't assign this pointer to an array. In other words, you can't make an array point to something else once created.</p> <p>What you should do is declare the array as a pointer instead.</p>