Differences between Windows and Linux in Chinese this document __linux

Source: Internet
Author: User

Use fopen ("", "WB") or fopen ("", "RB") in binary mode under Windows
B is the meaning of binary mode, B is only valid in Windows, in Linux with the results of R and RB is the same
All text lines under UNIX and Linux end with \ n, and all text lines under windows are ended with \ r \ n
On the Windows platform, open the file in text mode without B:

When the file is read, the system converts all "\ r \ n" to "\ n"

When the file is written, the system converts "\ n" to "\ r \ n" written

When you open a file in binary mode under Windows, neither read nor write makes this conversion
Under the Unix/linux platform, there is no difference between text and binary mode, and "\ r \ n" is entered as two characters.
So, the line breaks for text files under Windows platform are "\ r \ n", and the line breaks under Linux are "\ n"


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.