title: Deleting elements from a malloc'd array in C
body: <p>So I have</p>
  
  <pre><code>int * queue;
  queue = (int*)malloc(size) //size being a user variable
  </code></pre>
  
  <p>Since this is a queue, it will be a FIFO deal when deleting elements. I specifically have to use an array instead of a linked list to do this. When I delete, I just shift every number over to index-1. However, how do I get rid of the last number? So if I malloc size for a 5 element array, then input <code>1 3 2 4 _(nothing)</code> then I delete so it becomes <code>3 2 4 4 _</code>. How do I get rid of that second 4 that shouldn't be there. I want <code>3 2 4 _ _</code>. I thought I would just set <code>queue[last_element] = NULL</code> to get rid of it but that throws an "assignment makes integer from pointer without a cast" warning. Whats the correct way to do this then?</p>