Solved

Writeing new line in CFile

Posted on 2004-09-22
4
1,058 Views
Last Modified: 2013-11-20
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
Comment
Question by:elchuma
  • 2
4 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
"\r\n" should do the trick instead of just "\n"
0
 

Author Comment

by:elchuma
Comment Utility
It dosen't works. instead new line displays - sqare. If I try to paste sqare here text go to new line?!
0
 
LVL 16

Accepted Solution

by:
nonubik earned 100 total points
Comment Utility
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
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
\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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now