Tools.h++ Manual
104011 Tandem Computers Incorporated 20-5
20
This program reads lines from a file specified on the command line and prints
them to standard output. By using the full abilities of the
RWCString
class it
could be greatly simplified:
There are countless other such examples. The point is, if it's looking awkward
to you, it probably did to us. Most likely there's a better way!
main(int argc, char* argv[])
{
ifstream fstr(argv[1]);
RWCString line;
while (line.readLine(fstr)) {
cout << line;
}
}