Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以解释以下之间的区别:
std::cout << "stuff\n";
...和...:
std::cout << "stuff" << std::endl;
它们将生成相同的字符(即回车),但std::endl也会刷新流,如果在生成大量输出时过度使用,这可能会对性能产生影响。
std::endl