Drill down into Windows to enter a carriage return line (\ r \ n) or a newline carriage return (\n\r) of the detailed _c language

Source: Internet
Author: User
Tags windows x86

Remember to output a carriage return (skip to the beginning of the next line) with 0DH (\ r) and 0AH (\ n) when Windows X86 assembly language. The problem is, under Windows is the first carriage return to change the line or the first line and then enter? Line break on Unix system only \n,mac OS only \ r (said online, no MAC OS, no proof), will not appear above the problem.

Now create a new text document that reads as follows:


It is now read into a string in C-language binary (refer to my article: Drill down into the C language to read the file into a string and write the string to the file) and output in decimal. The results are as follows


You can see that the carriage return is 13 and 10 is the \ r \ n, that is, enter the first line.

Let's take a look at what happens when you swap the \ r \ n between A and B:


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.