C++ file processing
Justin Findlay
farquharsoncraig@yahoo.com
Wed Jul 2 23:12:00 GMT 2003
Why doesn't ifstream overload operator>> for const
char * types so that one could do this:
string keep_this_string;
ifstream fin( "fin.txt" );
while ( fin )
{
fin >> "Ignore this string everywhere it occurs" >>
keep_this_string >> "Ignore something else";
use_it( keep_this_string.c_str() );
}
How about an istream member getline() that returns a
formatted string:
istringstream iline;
iline.str( fin.getline() );
iline >> "Ignore this string everywhere it occurs" >>
keep_this_string >> "Ignore something else";
use_it( keep_this_string.c_str() );
or even just:
string ilinestr;
fin.getline( ilinestr );
Any thoughts, suggestions, instruction, direction is
most welcome.
Justin
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
More information about the Gcc-help
mailing list