所以我在这里得到了这个每个人都明白理解的小程序。 include <iostream>
include <fstream>
using namespace std;
int main() {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
我有一个文本文件,每行有一个十六进制值。类似于 80000000
08000000
0a000000
现在我正在写一个C++代码来直接读取它。有点像 fstream f(filename, ios::in);
while(!f.eof)
{
int x;
char ch;
f>>std::hex>>x>>ch; // The intention of h