'\n' 换行,光标移到下一行的开头;
'\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;
return 0;
}
————————————————
原文链接:https://blog.csdn.net/juddi/article/details/83177084
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询