I thought that this code produce a file so:Code:
text ="left\n"; text =text +"right\n"; f.open(IO_WriteOnly); xstrm << text; f.close();
Instead:Code:
left right
how can I do? thanks.Code:
leftright
Printable View
I thought that this code produce a file so:Code:
text ="left\n"; text =text +"right\n"; f.open(IO_WriteOnly); xstrm << text; f.close();
Instead:Code:
left right
how can I do? thanks.Code:
leftright
it seems you forget a flag in the open method of your file.
in Qt4 the flag is QIODevice::Text, so in Qt3 it should be something like IO_Text
on Windows, line breaks aren't only "\n" but actually "\r\n"
One should use endl() to write a newline to the stream instead of using \n.
Because windows consider a new line to be "\n\r" , they just can't figure out that computers are not typewriters anymore :pQuote:
Originally Posted by wysota