I'm trying to implement my own version of the stl vector class. I have gotten the push method to work properly, as well as the pop to semi-work. The only problem is when the logical size of the array is less then half of the allotted size for the array. I then try to shorten the size of the array by half. I get a runtime error saying I got a memory access problem on "delete dynamic_array;"
Any ideas on why I'm getting the runtime error, as well as suggestions on how I could better improve the class would be greatly appreciated.