reading string from file with blanks, why?

Hi
I'm reading from the file filled with:
cplusplus do it well

using
getline(data_file, string_line);

next
cout << string_line;

and in console appears:
■c p l u s p l u s d o 0

Anybody know why there are blanks before the char and square at the beginning and 0 at the end.

Im including these libraries:
#include <iostream>
#include <fstream>
#include <string>
A guess would be the file is in Unicode with 2 bytes per character, but string line is a char array.
I would be tempted to go along with Faldrax.
Just out of interest what program was used to create the text file that you are trying to read. Have you tired opening this file with a plain old ascii
program like Notepad??
Topic archived. No new replies allowed.