So basically my program keeps aborting because subscript is out of range. What I am trying to do is get numbers from a file using vectors. It only aborts when I try to use case 3. Right now I am using m<salary.size() so that I can get all the numbers. I don't know what I am doing wrong.
So, just going off what I am looking at here, you might be running into the problem of your
salary.size()
For C++ vector the size function returns the number of elements (or actual objects) within the container. This is not the same as the storage capacity.
As with an array, a vector's first element is at index 0. So, if you have a vector with x number of elements, valid indexes are from 0 to x-1. You are trying to use x as an index. Don't do that.