In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the use of binary files and sequential reading and writing in CAccord +. The article is very detailed and has a certain reference value. Interested friends must finish reading it!
Overview
Unlike text files, binary files can be used for any type of file (including text files).
Binary vs ASCII
For numerical data, the ASCII form is different from the binary form. ASCII files are intuitive and easy to read, but they generally take up more storage space and take time to convert. Binary file is the internal form of computer, which saves space and does not need to be converted, but can not be displayed intuitively.
For character information, it is stored in ASCII code in memory, whether output by ASCII file or binary file, the form is the same.
Binary write # include # include using namespace std;int main () {int x = 12345; ofstream outfile ("binary.txt", ios::binary); outfile.write ((char*) & x, 2); / / write outfile.close (); / / release return 0;}
Output result:
ASCII write
Write int x = 12345 to the file.
# include # include using namespace std;int main () {int x = 12345; ofstream outfile ("ASCII.txt"); outfile
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.