Writeing new line in CFile

Hi experts.
I have one more problem with CFile.
How to write a new line after custom text. I tryed with "\n", but it doesn't works
elchumaAsked:
Who is Participating?
 
nonubikCommented:
I think the 'square' is displyed by your text viewer.
You can use CStdioFile::WriteString(..) method to write some text followed by the newline char.
CStdioFile is derived from CFile.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
"\r\n" should do the trick instead of just "\n"
0
 
elchumaAuthor Commented:
It dosen't works. instead new line displays - sqare. If I try to paste sqare here text go to new line?!
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
\r\n is a return - new line pair.  That should give you a new line in the CFile (It works here, just a new line char is not enough as you have found out - as nonubik says this is probably an artefact of how you view the file contents)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.