From: Ulrich E. <Doo...@kn...> - 2001-01-06 12:32:47
|
> I want to read a line, actually, but not the 'next' line, but > the 'previous' line; so my idea is to read a potion of file, > and search for line-break char, and so and so...., > but I can't find a good function to read some 256 bytes > to a buffer, regardless of spaces or line-break chars... > ( do I need to read char by char ?) > //untested code, no warranty #include <fstream> #include <string> // omitting 'std::' for clarity // open the file ifstream in; in.open("file.txt"); // read a line :) string line; getline(in, line); uli |