• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1194
  • Last Modified:

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
0
elchuma
Asked:
elchuma
  • 2
1 Solution
 
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
 
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 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.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now