If there are these two keywords then they must have their own meaning. So I want to know what makes them different and what is their code?
相关问题
- how to split a list into a given number of sub-lis
- Generate string from integer with arbitrary base i
- Converting a string array to a byte array
- How to convert a string to a byte array which is c
- format ’%s’ expects argument of type ’char *’
相关文章
- JSP String formatting Truncate
- Selecting only the first few characters in a strin
- Python: print in two columns
- extending c++ string member functions
- Google app engine datastore string encoding proble
- How to measure complexity of a string?
- What is the limit in size of a Php variable when s
- boost split with a single character or just one st
Since I can not comment because of not having enough reward points I have to answer to correct answer given by @Burhan Khalid.
In very layman language Enter key press is combination of carriage return and line feed.
Carriage return points the cursor to the beginning of the line horizontly and Line feed shifts the cursor to the next line vertically.Combination of both gives you new line(\n) effect.
Reference - https://en.wikipedia.org/wiki/Carriage_return#Computers
A line feed means moving one line forward. The code is
\n
.A carriage return means moving the cursor to the beginning of the line. The code is
\r
.Windows editors often still use the combination of both as
\r\n
in text files. Unix uses mostly only the\n
.The separation comes from typewriter times, when you turned the wheel to move the paper to change the line and moved the carriage to restart typing on the beginning of a line. This was two steps.
Both of these are primary from the old printing days.
Carriage return is from the days of the teletype printers/old typewriters, where literally the carriage would return to the next line, and push the paper up. This is what we now call
\r
.Line feed
LF
signals the end of the line, it signals that the line has ended - but doesn't move the cursor to the next line. In other words, it doesn't "return" the cursor/printer head to the next line.For more sundry details, the mighty wikipedia to the rescue.