Home >Backend Development >C++ >Usage of \n in c++
In C, the character "\n" represents a newline character and can be used in the following ways: Use cout << "\n" to break a newline. Use the endl manipulator to both wrap lines and refresh the output stream.
Usage of \n in C
In the C programming language, the character '\n' represents a newline character . It is used to move the output to the next line.
Usage:
Example:
<code class="cpp">#include <iostream> using namespace std; int main() { cout << "Hello" << endl; cout << "World" << "\n"; return 0; }</p> <p>Output:</p> <pre class="brush:php;toolbar:false"><code>Hello World</code>
Note:
The above is the detailed content of Usage of \n in c++. For more information, please follow other related articles on the PHP Chinese website!