C++ file processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux