HI, I need to increase the size of my vector. However the program crashes.
How do I increase the size and prevent it from crashing. Below is the vector in question.
When I do that I get an "Unhandled Exception: System.AccessViolationExeption: Attempted to read or write protected memory. This is often an indication that other memory is corrupt"
We don't have enough information to tell what is wrong. It might be that you're accessing an array element out of bounds (e.g. Image_PNG[6005].resize(85000);) but it could also be something completely unrelated. UB/memory corruption does not necessary crash right away but can sometimes cause bugs in other parts of the program. Using a memory debugger such as valgrind (not available on Windows) or an UB/address sanitizer (supported by all major compilers, e.g. with GCC you can enable it using the compiler flag -fsanitize=address,undefined) can often help you find these kind of problems (the cause, which is not necessarily close to where the crash happens). Otherwise if you cannot figure it out yourself I recommend creating a minimal example that demonstrates the problem and post it here so that we can have a look. https://en.wikipedia.org/wiki/Minimal_reproducible_example