[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

Easy Archiving

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
jrmcg
Asked:
jrmcg
  • 2
1 Solution
 
nietodCommented:
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
 
nietodCommented:
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
 
jrmcgAuthor Commented:
Thanks Todd,

That is what I needed.

JR
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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now