[SOLVED] Writing a new line in Qt5 is not working
-
I tried both << endl and << "\n" but it doesn't write me a new line. What's wrong with it?
I intend to do it like this?line1
line2
line3but when I open the file they're just
line1line2line3
Please suggest me some tips for this. Thank you in advance
-
Hi,
What class are you using to write the file?
What OS are you writing the file in?
What are you using to read the file?
Linux uses '\n' but Windows uses '\r\n' for newlines. However, if you are using Qt's text writing classes, you just provide '\n' and Qt will convert it to '\r\n' for you automatically.
-
To what stream do you send it?
Better show some code. -
Unix base (Linux and OSX) OS's uses "\n" while Windows uses "\r\n"
-
Thank you all it works with ā\r\nā
Thanks again it solved