Home > Backend Development > C#.Net Tutorial > What are the line breaks in c++?

What are the line breaks in c++?

angryTom
Release: 2019-11-04 15:22:50
Original
17421 people have browsed it

What are the line breaks in c++?

c What are the line breaks

\n Line break, the cursor moves to the next line at the beginning of If the next line is output, the previous contents of this line will be overwritten one by one;

#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;  
}
Copy after login

Result:

this is the first line
this is the third linee
this is the fifth line
First
Second
Second23
这是换
行符
Presss any key to continue
Copy after login
Recommended course: C language tutorial

The above is the detailed content of What are the line breaks in c++?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template