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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:50:48+00:00 2026-06-03T03:50:48+00:00

I have a multimap declared as: typedef multimap <int, std::string> MM; I was having

  • 0

I have a multimap declared as:

typedef multimap <int, std::string> MM;

I was having trouble doing it how I normally do with no luck so used this method I found online:

std::string IntToStr( int n )
  {
  std::stringstream  result;
  result << n;
  return result.str();
  }

Then I call it passing it the int value of my multi map:

std::string stringNumber = IntToStr((*i).first);

What I get back is a bit of memory location I think, and the int converted tagged onto the end of this like:

64D20D6017

Where 17 is the score. What am I doing wrong? All I wanted to do was convert the results into a string to be used later.

  • 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-06-03T03:50:49+00:00Added an answer on June 3, 2026 at 3:50 am

    Just incase anyone ever gets a similar output, this was due to accidentally adding 2 cout to the line:

    cout << variable1 << cout << variable2;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multimap defined by typedef std::pair<int, int> comp_buf_pair; //pair<comp_t, dij> typedef std::pair<int,
I have a multimap defined by typedef std::pair<int, int> au_pair; //vertices typedef std::pair<int, int>
I have std::list<multimap<std::string,std::string>::iterator> > Now i have new element: multimap<std::string,std::string>::value_type aNewMmapValue(foo1,test) I want to
I have a guava HashMultimap like this Multimap<String, String> multiMap = HashMultimap.create(); multiMap.put(a, x);
I have a std::multimap where key is a custom class. Something like this: Class
I have a std::multimap , and I want to create a boost::iterator_range from equal_range
I have a strongly recursive function, that creates a (very small) std::multimap locally for
I have a mapping of String id -> Object . Apart from merely having
I have a dilemma of whether to have a multimap <int key, int value>
I'm using a C++ std::multimap and I have to loop over two different keys.

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.