Research solutions for R N

Source: Internet
Author: User
r \ n's Research
Because I was learning PHP, I was in this area. So write this post, in addition to conform, there are master did not say understand, novice can not understand.
I'm going to do it because I say it's not necessarily right.
\ r \ n represents a carriage return and a newline, in some cases the effect of \ r \ n is the same, and the meaning of carriage return and line break is also considered to be the same in most cases, since then, what is the difference?
So let's get to know their origins and their essential meanings.
The source is the printer
\ r meaning Enter English full name carriage return, referred to as CR return is the meaning, carriage is the meaning of the car, in the printer, refers to (typewriter and other machines) sliding bracket, it is obvious that you have seen the printer will know that the "car" can only move around, can not move up and down, Then the carriage return means to return to the initial position at the end of the line. But on the computer is difficult to describe, with the left ARROW key ← Move to the front of the line, that is the effect.
\ n meaning to change the full name of the new line or lines feed,feed here is to, add the meaning, in the printer middle finger and then added a line, because carriage can only move around, the line can only be printed paper to move, equivalent to the direction of the key ↓ effect.

Everyone now understand, now the meaning of the return and line and the keyboard enter is actually a \ r \ n effect (the return of the line is the effect of \ r \ n).

However, in the use should have a carriage return must have a line, then the effect of unification is also expected to do things, but the expression is not the same, so only Mac with \r,unix with \n,windows with \ r \ n
The fact that in Windows Notepad these three expressions and the effect of keyboard return is the same, about Windows has automatically turned to \ r \ n, but with \n\r (upside down order) \ r \ n (there are spaces in the middle) so it has two effects, but this is not absolute, For example, Unix looks like a return to the normal file in the Windows Notepad is not effective but there will be a small black box, this file I opened with Dreamweaver is normal.

In addition, it is said that the meaning refers to the end of a line. In fact, and the previous said no difference, this may be UNIX used it to represent the reason for the carriage return line.
There is the problem of soft return hard return, this software may be encountered in different platforms, the front refers to \ r \ n. But I have no experience to say is correct or not, but in Word shift+enter soft return is carriage return ^l,enter hard return is a paragraph ^p, this problem in the Web design will also encounter.

------Solution--------------------
Windows \ r \ n
Linux \ n
Mac \ r

This is the operating system of the Convention, it can be said to be a legacy of history
You know, there's no need to discuss it.
------Solution--------------------
discuss
Windows \ r \ n
Linux \ n
Mac \ r

This is the operating system of the Convention, it can be said to be a legacy of history
You know, there's no need to discuss it.

------Solution--------------------
Good post, really do a little research is good.
There is an overflow vulnerability in the win system that is caused by this type of control word.

The departure code looks like this:

int main (void)

{

for (; {
printf ("Hung up\t\t\b\b\b\b\b\b");

Print ("Hung up\t\t\b\b\b\b\b\b";

}

return 0;

}

Ignoring tabs before backspace causes memory to overwrite.
------Solution--------------------
Explore
Windows \ r \ n
Linux \ n
Mac \ r

This is the operating system of the Convention, it can be said to be a legacy of history
You know, there's no need to discuss it.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.