?
Solved

Easy Archiving

Posted on 1998-08-10
3
Medium Priority
?
229 Views
Last Modified: 2010-04-02
I am using an archive to save a CString to a  text file.
When I open the file for viewing (NOTEPAD) there are
characters inserted at the beginning of the file.  What
are they and how can I get rid of them?
0
Comment
Question by:jrmcg
[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
3 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 200 total points
ID: 1169833
An archive contains information use to recreate objects, not just the information in the objects.  Thus an archive of a CString contains more than text of the string.  it contains information that says that a CString is stored in the archive  (and other info as well.)
0
 
LVL 22

Expert Comment

by:nietod
ID: 1169834
You don't get rid of them.  But if you just want a file that has the contents of a string (or many strings), then you don't want an archive.  For that, you can use a C++ file stream and write the string to the file stream with the << operator.  The << operator for a file stream and a string will write the contents of the string only, it will not create an archive that indicates the type of data being written.

Let me know if you have questions.
0
 
LVL 2

Author Comment

by:jrmcg
ID: 1169835
Thanks Todd,

That is what I needed.

JR
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

743 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