Hi, it's me again,
Another two problems which I'm having with this example is that when in ofstream constructor I specify mode as binary:
ofstream fout("my_file.txt", ios_base::binary);
nothing is written to a file (at least I can't see there anything)
and another problem which I cannot cross is that I cannot write integers to a file only strings. What I'm doing is:
int a = 1;
fout.write(reinterpret_cast<char*>(&a), sizeof(int));
after this nothing is written in the file;
Hope someone will help me with this kerfuffle.
atch 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.