Output from CSV file is messed up

Hello everyone, I have been working on some code to read .csv files. So far I have been successful and I am able to read what's in the file,however the output is just a little messed up. The first row of the .csv file comes out like it was carriage returned or something despite there being no code telling it to do this.

Now before you read the output of the file, I made a small program in C++ to generate the .csv file and write everything to it. When I was running the application I just typed random letters just to see if I could write to the .csv file. So most of what's in the rows will be gibberish. The only thing I care about is the first row.