What does <CR> mean in C language

Source: Internet
Author: User
In text processing, CR, LF, cr/lf are line breaks used on different operating systems.

Unix/linux uses the newline character LF to indicate the next line,
The Mac OS system uses a carriage return CR to represent the next line.

LF using the ' \ n ' notation, the ASCII code is 10, and the 16 system is 0x0a.
So the line breaks in the Windows platform are represented in a text file using 0d 0a two bytes, while the line breaks on UNIX and Apple platforms are expressed in 0a or 0d of a byte.
The runtime on the general operating system automatically determines the line-wrapping format of the text file. A program that runs on Windows generates a text file in a cr/lf format, while running on Linux generates a text file that is wrapped in the LF format.
A file file that uses another line break on one platform can cause unexpected problems, especially when editing program code. Sometimes the code appears normal in the editor, but when you edit it, the error occurs because of a line break.
Many text/code editors have a newline character conversion feature that allows you to swap line breaks in text files in different formats.
In both C and other languages, the definition of CR,LF is not a change in the law of God. Basically as described above.

What does <CR> mean in C language

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.