Read line by line

Is there any way to read line by line from a file with the WIN32 function ReadFile()? Or at least a work-around...
isn't there something like ReadLine() ?
Unfortunately, no.
in text-mode u can read every char on its own and add it to your string... while doing so u may check for the character wether it is '\n'/endl/etc or not...
Are you suggesting something like:
1
2
3
4
5
6
7
8
9
DWORD dwChars;
LPSTR lpChar[2]; //one char+zero
std::string str;
ReadFile(hFile, //some file
              lpChar,
              1,
              &dwChars,
              NULL);
str += lpChar;


It would be in a loop but you get my idea.
Topic archived. No new replies allowed.