We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::endl
https://parallel101.github.io/cppguidebook/cpp_tricks/#cout-endl endl 是一个典型的以讹传讹错误写法,只有当你的输出是指向另一个进程的管道时,其附带的刷新功能才有作用。 当输出是管道时,cout 需要 endl 才能刷新。 当输出是普通控制台时,cout 需要 endl 才能刷新。
endl 是一个典型的以讹传讹错误写法,只有当你的输出是指向另一个进程的管道时,其附带的刷新功能才有作用。
当输出是管道时,cout 需要 endl 才能刷新。 当输出是普通控制台时,cout 需要 endl 才能刷新。
我认为此处最后一句存在问题。普通控制台并不一定需要 endl 才能刷新。
endl 操纵符大多时候都是冗余的,"\n" 大多数时候也会进行刷新,即使是文件读写也很少会使用 endl 。
endl
"\n"
The text was updated successfully, but these errors were encountered:
想说的应该是:
当输出是管道时,cout 需要 endl 才能刷新。 当输出是普通控制台时,cout 只需 '\n' 就能刷新,无需 endl。
复制粘贴害的。
Sorry, something went wrong.
已修复
No branches or pull requests
我认为此处最后一句存在问题。普通控制台并不一定需要 endl 才能刷新。
endl
操纵符大多时候都是冗余的,"\n"
大多数时候也会进行刷新,即使是文件读写也很少会使用endl
。The text was updated successfully, but these errors were encountered: