Okay, i've got a file open, call it infile. I've got a simple while(!eof),
but say the first line of my file is "<?xml version="1.0">" , then it takes
two iterations to get the string. first 'line' is "<?xml", then 'line' is
"version="1.0"" , what's happening that I need to change the behavior of so
that I can get lines delimitted by the newlines in the file?
std::string line;
std::ifstream infile("whateve r.txt", std::ios_base:: in);
while(!infile.e of())
{
infile >> line;
std::cout << line << std::endl;
line = "";
}
infile.close();
Thanks for your time,
Kevin Grigorenko
but say the first line of my file is "<?xml version="1.0">" , then it takes
two iterations to get the string. first 'line' is "<?xml", then 'line' is
"version="1.0"" , what's happening that I need to change the behavior of so
that I can get lines delimitted by the newlines in the file?
std::string line;
std::ifstream infile("whateve r.txt", std::ios_base:: in);
while(!infile.e of())
{
infile >> line;
std::cout << line << std::endl;
line = "";
}
infile.close();
Thanks for your time,
Kevin Grigorenko
Comment