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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:24:22+00:00 2026-05-27T06:24:22+00:00

I want to create a structure that holds distinct strings and assign to each

  • 0

I want to create a structure that holds distinct strings and assign to each one of them some (not one unique) int values. After I have filled that structure, I want to check for each string how many different int have been assigned to and which exactly are they. I know that it is possible to tackle this with a multimap. However I am not sure if (or how) it is possible to get all the distinct strings contained to the multimap, since the function “find” requires a parameter for matching, while I do not know when searching which distinct values could be in the multimap. How could this be done with a multimap?

As an alternative solution I tried to use a simple map with a vector as value. However I still cannot make this work because the iterator of the vector does not seem to be recognized and it indicates me : iterator must a have a pointer to class type.

map<string, vector<int>>::iterator multit;
int candID1, candID2, candID3;

for(multit=Freq.begin(); multit!=Freq.end(); multit++)
{
    if((*multit).second.size()==3)
    {
        vector<int> vectorWithIds = (*multit).second;

        for(vector<int>::iterator it = vectorWithIds.begin();
            it != vectorWithIds.end();it++)
        {
            candID1 = it->        Problem: The iterator is not recognized
        }
    }

}

Could anyone detect the problem? Is there an attainable solution, either on the first or the second way?

  • 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-27T06:24:23+00:00Added an answer on May 27, 2026 at 6:24 am

    What is it->? It’s vector if ints, you probably want *it.

    P.S. I have to admit I haven’t read the whole prose.

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

Sidebar

Related Questions

I want to create a simple structure that holds an identifier of type int
I want to create a table structure with checkbox for each row and each
Data table structure is: id1,id2,id3,id4,... (some other fields). I want to create summary query
I want to create a simple http proxy server that does some very basic
I want to create binary search tree data structure in C/C++ where each node
i want to create a structure like that: [{title:'Imágenes', extensions:'jpg,gif,png'}, {title:'Todos', extensions:'*'}] but i
I want to create a data structure that I can copy to the clipboard
I want to create a structure Degrees for a GPX library. In the XSD
I want to create a function that performs a function passed by parameter on
I want to create a custom XML structure as follows: <Hotels> <Hotel /> </Hotels>

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.