Im trying output the content of my vector to a csv file that already as 3 elements, however using this code outputs 4 empty elements following each of the 3 already established elements. It does not print out the vector that has been created earlier which has been confirmed to exist by cout.
As ne555 said your code does not compile. I see no closing } for the while loop or the for loop and the "outFile" in the for loop appears to be incomplete.
You think the problem is in the code that you posted, but the problem could have started elsewhere and no one see that part. And without the input file one can only guess if you are reading it correctly and i do not think you are.
Do not expect people to look through your previous posts for answers. Your code today is likely much different than what you posted in the past.
Like hoogo and ne555 have said post your whole code and the input file to get a better answer.