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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:36:13+00:00 2026-06-09T05:36:13+00:00

When programm execute this private method map<char*, vector<MAILPACK>>::iterator mit; vector<MAILPACK>::iterator dit; for(mit=funcs.begin(); mit!=funcs.end(); mit++)

  • 0

When programm execute this private method

map<char*, vector<MAILPACK>>::iterator mit;
vector<MAILPACK>::iterator dit;
for(mit=funcs.begin(); mit!=funcs.end(); mit++) {
    TRACE tr;
    tr.crc32 = crc32;
    strncpy(tr.name, (*mit).first, sizeof(tr.name));
    int i = 0;
    for(dit=(*mit).second.begin(); dit!=(*mit).second.end(); dit++){
        tr.nodes[i++] = dit->dwAddr;
    }       
}   

I get error like: Expression:map/set iterator not incrementable

This function iterate through private map std::map<char*, std::vector<MAILPACK>> funcs;

Where I’m wrong?
Thx

P.S. oh, I found that I didn’t control boundaries when saving addresses into tr.nodes.
But this is not the point…

  • 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-09T05:36:16+00:00Added an answer on June 9, 2026 at 5:36 am

    Some typedef‘s wouldn’t go astray. And pre-increment your iterators, avoiding useless iterator object copies.

    typedef vector<MAILPACK> Mailpacks;
    typedef map<char*, Mailpacks> MailpackMap;
    
    for(MailpackMap::iterator mit=funcs.begin(); mit!=funcs.end(); ++mit) 
    {
      TRACE tr;
      tr.crc32 = crc32;
      strncpy(tr.name, (*mit).first, sizeof(tr.name));
      int i = 0;
      Mailpacks& mail = (*mit).second;
      for(Mailpacks::iterator dit= mail.begin(); dit!=mail.end(); ++dit)
      {
        tr.nodes[i++] = dit->dwAddr;
      }       
    }
    

    I agree with @Chowlett, and think you’re stomping out of your tr.nodes bounds and over one of your iterators. Since you are instantiating your TRACE object during the loop, there is a good chance this is happening. You will usually get the Expression:map/set iterator not incrementable error when your iterator has been invalidated.

    Is there any reason you’re tr.nodes member can’t be a vector too?

    tr.nodes.push_back(dit->dwAddr);
    

    I could be wrong, more information always helps.

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

Sidebar

Related Questions

I was advised to use this code to make my method execute after a
This is with reference to the below question: Execute program from within a C
I have this program that should execute a piece of code base on the
I have a method send() that I wish to execute/call every 1 second. I'm
I'm trying to execute some methods (in this particular case, rdOnAllDone) from a third
So i have this code in a .NET 2.0 console app: [DllImport(kernel32.dll)] private static
I am trying to make this button disable the two other buttons and execute
I'm using NtQueryObject(handle, OBJECT_INFORMATION_CLASS.ObjectTypeInformation, IntPtr.Zero, 0, out length); in my program, but this executes
Can I execute a program from a JScript script in such a way that
I want to execute a program which takes in 1 text file(say like Text.exe),

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.