Solved

Easy Archiving

Posted on 1998-08-10
3
221 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

747 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

12 Experts available now in Live!

Get 1:1 Help Now