Infile >> STR does not continue to enter the return space.
I don't know that std :: noskipws does not play this role, even if it is not used, the GCC 2.95.2 used does not support NoskiPws.
-------------------------------------------------- ----------------------
Iostream famous expert Dietmar Kuehl gives two methods
Std :: ifstream in ("some.file");
Std :: istreambuf_iterator beg (in), end;
Std :: string str (beg, end);
or
#include
Std :: ifstream in ("some.file");
Std :: ostringstream TMP;
TMP << in.rdbuf ();
Std :: string str = tmp.str ();