Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3954110
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:03:25+00:00 2026-05-20T02:03:25+00:00

I’m just trying to write some text data out to a tab-delimited file. Here’s

  • 0

I’m just trying to write some text data out to a tab-delimited file. Here’s the code. Name() and File() return CStringW, while ID() returns int,

ofstream myfile(file);

if (myfile.is_open())
{
    v::iterator i = begin();

    while(i != end())
    {
        myfile << i->Name() << L"\t" << i-ID() << L"\t" << i->File() << endl;
       i++;
    }

    myfile.close();

 }

But instead of getting the output I expect, the file looks like this

001554B00043F66840043F668001554F8
001555400043F6685440043F66800155588
001555F00043F6686000043F66800155638
001556B00043F6686240043F668001556F8
001557700043F6686680043F668001557B8
001558300043F6686800043F66800155878
001558E00043F6688560043F66800155928
001559C00043F6688720043F66800155A08
00155A700043F6689480043F66800155AB8
00155B200043F66810440043F66800155B68
00155BD00043F66811320043F66800155C18
00155C800043F66812840043F66800155CC8
00155D300043F66814040043F66800155D78
00155DE00043F66815360043F66800155E28
00155E900043F66815840043F66800155ED8
00155F400043F66816880043F66800155F88
001560180043F66817040043F66800156050
001560C80043F66817360043F66800156110

What gives?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T02:03:25+00:00Added an answer on May 20, 2026 at 2:03 am

    Use a wofstream, which has the appropriate operators for const wchar_t *.

    wchar_t * to ostream will use operator<<(ostream &, void *) as there’s no operator for wchar_t *

    EDIT: Use .GetString() on the CStringW’s.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have some data like this: 1 2 3 4 5 9 2 6
I want use html5's new tag to play a wav file (currently only supported
I have a JSP page retrieving data and when single or double quotes are
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to loop through a bunch of documents I have to put
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.