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

  • SEARCH
  • Home
  • 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 6377219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:50:36+00:00 2026-05-25T01:50:36+00:00

I am new to C++. I was just going through some code and got

  • 0

I am new to C++. I was just going through some code and got this doubt.

The code had some CStringList defined somewhere. I wanted to print that to a file. So I wrote the below code

 CStringList *stringListDev;
 .....
 .....
 .....
 ..... 
 ofstream myfile("example.txt");
 for(int i=0; i<stringListDev->Count; i++)
 {
    myfile << stringListDev[i];
 }

I was getting an error saying << not defined on list or something.
Please guide me how to write contents of a stringlist to a file in C++.

  • 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-25T01:50:36+00:00Added an answer on May 25, 2026 at 1:50 am

    I got it myself. The code was very simple

       CStringList *stringListDev;
       .....
       .....
       .....
       ..... 
       ofstream myfile("example.txt");
       for(int i=0; i<stringListDev->Count; i++)
       {
          myfile << stringListDev->Strings[i];
       }
    

    Thanks for all your responses!! You people rock !!

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

Sidebar

Related Questions

I'm going through some new code I just wrote and adding NDoc sytle comments
Going through my code, I was hoping to remove instances where I do this:
I was going through some old code of mine and came across a hybrid
I'm just getting going with ASP.NET MVC and I'm also new to unit testing
I'm going crazy today. I just tried to insert a new record and it
I just wrote a new web part and now I am getting this error
I just wrote some new utility methods within a non-page class for an existing
I have spent quite some time going through similar questions here and have not
Since my other bug got solved, I'm posting a new question for this bug.
After upgrading Xcode to the 4.2, I'm going through and fixing all the new

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.