I've created a sieve of eratosthenes. The intial vector contains numbers 1- howmany and then replaced with 0 if not prime.
I want to remove the 0s. Instead of deleting vector elements I created a new vector to copy all non-0 elements but the program keeps crashing (when howmany is more than 100).