File tree Expand file tree Collapse file tree 1 file changed +35
-2
lines changed
Expand file tree Collapse file tree 1 file changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ std::wostream std::cerr;
3636std::wostream std::clog;
3737```
3838
39- 宽字符流的讲解将放到一个专题中,见 ^[ locale.wide.stdio ] 。
39+ 宽字符流的讲解将放到一个专题中,见 ^[ locale.iostream.wide ] 。
4040
4141## 介绍
4242
@@ -305,7 +305,28 @@ $ 1 2
305305
306306` std::cout ` 和 ` std::clog ` 输出流具有行缓冲 ^[ iostream.buf] 。
307307
308- TODO
308+ ``` cpp
309+ #include < iostream>
310+ #include < thread>
311+ #include < chrono>
312+
313+ int main () {
314+ std::cout << "第一条消息\n";
315+ int i;
316+ std::cout << "第二条消息开始...";
317+ std::cin >> i;
318+ std::cout << "结束\n";
319+ return 0;
320+ }
321+ ```
322+
323+ 运行结果(Linux):
324+
325+ ```
326+ 第一条消息
327+ $ 1234
328+ 第二条消息开始...结束
329+ ```
309330
310331### ` std::cerr ` 与 ` std::clog ` 的区别
311332
@@ -370,6 +391,18 @@ TODO
370391
371392TODO
372393
394+ ## 输入字符串
395+
396+ TODO
397+
398+ ## 自定义分隔符
399+
400+ 见 ^[ locale.iostream.imbue] 。
401+
402+ ## 输入一整行
403+
404+ 见 ^[ iostream.getline] 。
405+
373406## 行缓冲升级为全缓冲
374407
375408``` cpp
You can’t perform that action at this time.
0 commit comments