我是靠谱客的博主 平常丝袜,这篇文章主要介绍c++换行符有哪些,现在分享给大家,希望可以做个参考。

c++换行符有哪些

n 换行,光标移到下一行的开头;

endl,把缓冲槽的内容输出到控制台;

r 回车,光标移到当前行的开头,不会换到下一行,如果接着输出的话,本行以前的内容会被逐一覆盖;

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream> using namespace std; int main() { cout << "this is the first linen"; cout << "this is the second liner"; cout << "this is the third linen"; cout << "this is the fouth liner"; cout << "this is the fifth linen"; cout<<"First"<<"n"<<"Second"<<endl; cout<<"First123"<<"r"<<"Second"<<endl; cout<<"这是换"<<endl<<"行符"; return 0; }
登录后复制

结果:

复制代码
1
2
3
4
5
6
7
8
9
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++换行符有哪些的详细内容,更多请关注靠谱客其它相关文章!

最后

以上就是平常丝袜最近收集整理的关于c++换行符有哪些的全部内容,更多相关c++换行符有哪些内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(96)

评论列表共有 0 条评论

立即
投稿
返回
顶部