Solved

Writeing new line in CFile

Posted on 2004-09-22
4
1,092 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 12123903
"\r\n" should do the trick instead of just "\n"
0
 

Author Comment

by:elchuma
ID: 12124066
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
ID: 12124876
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
ID: 12130482
\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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 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