I have a function to resize a dynamic array, but it fails, even though there is more than enough memory. I am compiling my code with visual c.
This is my code: