C language--file operation mode

Source: Internet
Author: User
Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/47450667

"RT" Simply reads open a text file. Just agree to read the data
"WT" simply writes Open or creates a text file, agreeing only to write the data
"At" Appends open a text file and writes data at the end of the file
"RB" simply reads open a binary file. Just agree to read the data
"WB" simply writes open or create a binary file. Just agree to write the data
"AB" appends open a binary file and writes data at the end of the file
"rt+" read and write open a text file. Agree to read and write
"wt+" read/write open or create a text file. Consent to read and write
"at+" read and write open a text file. Agree to read, or append data at the end of the document
"rb+" read and write open a binary file, agreeing to read and write
"wb+" read/write open or create a binary file, agree to read and write
"ab+" reads and writes open a binary file. Agree to read, or append data at the end of the document

There are several explanations for how files are used:

How the file is used by R,w,a,t,b. + Six characters to spell, the meaning of each character is:

R (Read): Read
W (write): Write
A (append): Append
T (text): Literal file, can be omitted without writing
B (banary): binary file

C language--file operation mode

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.