Link to home
Start Free TrialLog in
Avatar of shaolinfunk
shaolinfunkFlag for United States of America

asked on

How do I output text to a text file?

I am trying to debug a program. In order to this I want to output some text contained in a CString variable to c:\debug.txt.

I already have the debug message I want in CString "csMessage".  How do I output the contents of  csMessage to c:\debug.txt.  

Code that I can use would be much appreciated!
Avatar of shaolinfunk
shaolinfunk
Flag of United States of America image

ASKER

I forgot to add..c:\debug.txt does not exist yet.  How do I make it so that your function creates this file as well?  And if the file did already exist to just delete it and/or write over it?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi JKR,

Works perfectly, thanks!!