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 4037292
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:19:47+00:00 2026-05-20T12:19:47+00:00

Apologies in advance, because I suspect this may be a silly question. I have

  • 0

Apologies in advance, because I suspect this may be a silly question.

I have written a function for reading in data from an external file. I then use the data to perform calculations using other code I have written.

The function works by finding a data label that looks like this:

 const std::string findMe = "<dataLabel>";  

Each time I want to find data, I replace dataLabel with the label of whichever data I need from the file.

Here’s what I want to do.
I don’t want to have to write in the label of the data I want each time. I want to be able to do this:

for (int i = 0; i < anyNumberOfDataSets; i++)  
{
    findMe = "<dataLabeli>"; 
    // Then run function for reading in data, put data into a vector.
}

I could then add any number of data sets to my external file, give each one the title
, and have each data set read into a vector.

The problem is, I simply can’t figure out how to write findMe = "<dataLabeli>". Is this even possible?

I have tried things like, findMe = "<dataLabel" << i <<, but no luck!

Any suggestions would be much appreciated.

  • 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-20T12:19:48+00:00Added an answer on May 20, 2026 at 12:19 pm

    you’ve already got the right answer, so this is just trying to help you with solving such problems in the future:

    Your core problem here is to convert the integer i into a string s (if you’ve done this, than you just do findMe = "<datalabel"; findMe += s; findMe += ">";.

    Googling for c++ convert integer into string will give you this as the first result. Problem solved.

    This is not saying “use google before/instead of asking”, it’s rather “try to identify the core problem”.

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

Sidebar

Related Questions

Apologies in advance for the long-winded question. I'm really a database programmer, but have
Greetings, Apologies in advance that I have not researched this toughly enough to answer
This could potentially be a dumb question so apologies in advance if it is.
This is my first question on Stack Overflow. Apologies in advance if I don't
I apologise in advance if this question isn't very specific. Would it be possible
I apologize in advance if this question seems remedial. Which would be considered more
Let me apologize in advance for the simplicity of this question (I heard Jeff's
(Apologies in advance. My math skills and powers of description seem to have left
I'm new to Django, so apologies in advance if this is a rookie issue.
This is a complex question, because there are a lot of moving parts. My

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.