title: How can I deallocate the last element of an array in C++?
body: <p>I have a dynamically allocated array like this: <code>a[1,2,3,*unallocated value*]</code> which has 4 elements. I also have a <code>length</code> variable from which I know how long it is.</p>
  <p>I want to remove the last element in this array and set it to unallocated or uninitialize it somehow.</p>
  <p>I think something like this might work <code>a[lenght-1]=*something-something*</code> but I don't know what to put on the end. Is there a way I can unallocate a single element? Or do I have to make a new array and copy all the elements into it except the last one?</p>
  <p>Thanks in advance.</p>