[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1158
  • 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
 
AndyAinscowCommented:
"\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
 
AndyAinscowCommented:
\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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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