十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
c++的换行符怎么用?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
\n 换行,光标移到下一行的开头;
endl,把缓冲槽的内容输出到控制台;
\r 回车,光标移到当前行的开头,不会换到下一行,如果接着输出的话,本行以前的内容会被逐一覆盖;
#includeusing namespace std; int main() { cout << "this is the first line\n"; cout << "this is the second line\r"; cout << "this is the third line\n"; cout << "this is the fouth line\r"; cout << "this is the fifth line\n"; cout<<"First"<<"\n"<<"Second"< 结果:
this is the first line this is the third linee this is the fifth line First Second Second23 这是换 行符 Presss any key to continue关于c++的换行符怎么用问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注创新互联行业资讯频道了解更多相关知识。
本文标题:c++的换行符怎么用-创新互联
转载源于:http://xjjierui.cn/article/diioce.html