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
Solved

Easy Archiving

Posted on 1998-08-10
3
225 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
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 50 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
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 be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

856 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