?? io20_8.01.c
字號:
#include <string>
#include <fstream>
#include <sstream>
/**
** note: no available sstream implementation
** available at this time -- code has not
** been exercised
**
**/
string read_file_into_string()
{
ifstream ifile( "alice_emma" );
ostringstream buf;
char ch;
while ( buf && ifile.get( ch ))
buf.put( ch );
return buf.str();
}
int main()
{
string text = read_file_into_string();
// marks the position of each newline within text
vector< string::size_type > lines_of_text;
string::size_type pos = 0;
while ( pos != string::npos )
{
pos = text.find( 'n' pos );
lines_of_text.push_back( pos );
}
// ...
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -