C++编程中的cout语句,能不能不写endl,为啥?

2025-05-15 06:56:23
推荐回答(3个)
回答(1):

可以不写endl
因为<相当于 "\r\n"
也就是说
<

回答(2):

inserts a newline character and then flushes the buffer;
这是原文,我想它的意思是,用了这个操作符后,相当于加入了一个换行符‘\n’,同时清除原有缓冲。

回答(3):

可以哈