?? use_sbuf.cpp
字號:
// Operations with streambufs.
#include <iostream.h>
#include <fstream.h>
void main(void)
{
int c;
const char *filename = "_junk_.$$$";
ofstream outfile;
streambuf *out, *input = cin.rdbuf();
// Position at the end of file. Append all text.
outfile.open( filename, ios::ate | ios::app);
if (!outfile)
{
cerr << "Could not open " << filename;
return(-1);
}
out = outfile.rdbuf(); // Connect ofstream and streambuf.
clog << "Input some text. Use Control-Z to end." << endl;
while ( (c = input -> sbumpc() ) != EOF)
{
cout << char(c); // Echo to screen.
if (out -> sputc(c) == EOF)
cerr << "Output error";
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -