how to remove this broken line in the end?
I have this source and im trying to use it on linux:
Code:
#include <iostream>
#include <sstream>
#include <fstream>
using namespace std;
int main ()
{
char c;
ifstream in_file("./texto");
ostringstream var1;
while (in_file.get(c))
{
var1 << c;
}
cout << var1.str() << endl;
return 0;
}
the content of "texto" is:
to compile with g++-4.3:
Code:
$ g++ teste2.cc -o teste
then i have this:
Code:
fbs777@Linux1:/tmp$ ./teste
teste1
teste2
fbs777@Linux1:/tmp$
using the linux to read the file texto dont show anything after line2:
Code:
fbs777@Linux1:/tmp$ cat ./texto
teste1
teste2
fbs777@Linux1:/tmp$