Skip to content

Commit 5ba24db

Browse files
committed
update1
1 parent edbcfe0 commit 5ba24db

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

iostream.stdio.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ std::wostream std::cerr;
3636
std::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

371392
TODO
372393

394+
## 输入字符串
395+
396+
TODO
397+
398+
## 自定义分隔符
399+
400+
见 ^[locale.iostream.imbue]
401+
402+
## 输入一整行
403+
404+
见 ^[iostream.getline]
405+
373406
## 行缓冲升级为全缓冲
374407

375408
```cpp

0 commit comments

Comments
 (0)