^(* ̄(oo) ̄)^

  • 首页
  • 博客
  • 文档
  • 网盘
  • 仓库
  • 简介
Keep Learning
  1. 首页
  2. 博客
  3. 正文

c++ - IO

2024年10月16日 414点热度

io库

image-20241016163300095

image-20241016163355817

刷新输出缓冲区

std::cout << std::unitbuf; // 所有输出操作后都会立即刷新缓冲区
std::cout << "aa" << std::endl; // 输出 aa 和一个 换行,然后刷新缓冲区
std::cout << "aa" << std::ends; // 输出 aa 和一个 空字符,然后刷新缓冲区
std::cout << "aa" << std::flush;; // 输出 aa, 刷新缓冲区,不附加任何额外字符
std::cout << std::nounitbuf; // 回到正常的缓冲方式

程序崩溃的话,输出缓冲区不会被刷新。

image-20241016165005266

标签: c++
最后更新:2024年10月16日

九州安所如

程序员

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2023 zhu

鲁ICP备2026022547号