21xrx.com
2024-11-22 10:57:13 Friday
登录
文章检索 我的文章 写文章
What is the English word for "endl" in C++?
2023-07-04 01:31:19 深夜i     --     --
English word "endl" C++

If you have ever worked with C++, you must have come across the word "endl" at some point. This keyword is used to mark the end of a line in C++ programming language. But what is the equivalent English word for "endl"?

The English word for "endl" is "end line". It is simply a command in the C++ programming language that tells the compiler to move the output cursor to the beginning of the next line. This command is usually used with the "cout" statement to display output on the console in a formatted way.

In C++, "cout" is used to print output on the console. To display output on separate lines, you can use "endl" after each line of output. For example, if you wanted to print the words "Hello" and "World" on separate lines, you could write the following code:

cout << "Hello" << endl;

cout << "World" << endl;

When you run this code, the output will be displayed on separate lines, thanks to the use of the "endl" keyword.

In conclusion, "endl" in C++ stands for "end line" in English. It is a command that is used to tell the compiler to move the output cursor to the beginning of the next line. By using "endl" after each line of output, you can display text on separate lines in a formatted way.

  
  

评论区

{{item['qq_nickname']}}
()
回复
回复