Hi,
I'm trying to print to a file some data of objects and I'm trying to do this in pseudo xml format so my file would look like let's say:
<node>
data
</node>
I'm using write method:
fstream fout("my_file.txt");
fout.write("<name>", sizeof(7));
fout.write("\n", sizeof(2));
fout.write(this->name(), sizeof(this->name()).length());
fout.write("\n", sizeof(2));
fout.write("<name>", sizeof(8));
which I was convinced should produce output as I described above. Unfortunetly it is not the case and my output look like this:
"<na
Odin
name
I personally feel that it has to do with '<' character but I don't know where to hit and also another problem with this task is that when I set the opening mode to binary nothing is written to this file.
Thank you for any help.