
c++++换行符有哪些
\n 换行,光标移到下一行的开头;
endl,把缓冲槽的内容输出到控制台;
\r 回车,光标移到当前行的开头,不会换到下一行,如果接着输出的话,本行以前的内容会被逐一覆盖;
#include <iostream>
using 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"<<endl;
cout<<"First123"<<"\r"<<"Second"<<endl;
cout<<"这是换"<<endl<<"行符";
return 0;
}结果:
iHuzuCMS狐族内容管理系统,是国内CMS市场的新秀、也是国内少有的采用微软的ASP.NET 2.0 + SQL2000/2005 技术框架开发的CMS,充分利用ASP.NET架构的优势,突破传统ASP类CMS的局限性,采用更稳定执行速度更高效的面向对象语言C#设计,全新的模板引擎机制, 全新的静态生成方案,这些功能和技术上的革新塑造了一个基础结构稳定功能创新和执行高效的CMS。iHuzu E
0
立即学习“C++免费学习笔记(深入)”;
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++++换行符有哪些的详细内容,更多请关注php中文网其它相关文章!
c++怎么学习?c++怎么入门?c++在哪学?c++怎么学才快?不用担心,这里为大家提供了c++速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号