map problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kamran

    map problem


    Hi,

    Is there a limit to the length of a string in map ? I have the following:

    map<string, int>traceHeader Fields;

    and when later I say:

    traceHeaderFiel ds.insert(pair< string,
    int>("GeophoneG roupNumberFirst TraceOrigField" , 1));

    it crashes out wherease a shorter string works fine:

    traceHeaderFiel ds.insert(pair< string, int>("GeophoneG roupNu", 1));

    Anythin longer than 15 character fails !

    Thanks in advance

    Kamran

  • Victor Bazarov

    #2
    Re: map problem

    Kamran wrote:
    Is there a limit to the length of a string in map ?
    No.
    I have the
    following:
    map<string, int>traceHeader Fields;
    >
    and when later I say:
    >
    traceHeaderFiel ds.insert(pair< string,
    int>("GeophoneG roupNumberFirst TraceOrigField" , 1));
    >
    it crashes out wherease a shorter string works fine:
    >
    traceHeaderFiel ds.insert(pair< string, int>("GeophoneG roupNu", 1));
    >
    Anythin longer than 15 character fails !
    The problem is elsewhere.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask


    Comment

    • Bo Persson

      #3
      Re: map problem


      "Kamran" <kamran@uio.nos krev i meddelandet
      news:eao999$mhs $1@dolly.uninet t.no...
      >
      Hi,
      >
      Is there a limit to the length of a string in map ? I have the
      following:
      >
      map<string, int>traceHeader Fields;
      >
      and when later I say:
      >
      traceHeaderFiel ds.insert(pair< string,
      int>("GeophoneG roupNumberFirst TraceOrigField" , 1));
      >
      it crashes out wherease a shorter string works fine:
      >
      traceHeaderFiel ds.insert(pair< string, int>("GeophoneG roupNu", 1));
      >
      Anythin longer than 15 character fails !
      >
      Thanks in advance
      >
      Kamran
      >
      Are you using an older MS compiler? Where short and long strings have
      a different internal representation, but the debugger doesn't know
      that?


      How does it "crash out"?


      Bo Persson


      Comment

      • Kamran

        #4
        Re: map problem

        Bo Persson wrote:
        "Kamran" <kamran@uio.nos krev i meddelandet
        news:eao999$mhs $1@dolly.uninet t.no...
        >
        >>Hi,
        >>
        >>Is there a limit to the length of a string in map ? I have the
        >>following:
        >>
        >>map<string, int>traceHeader Fields;
        >>
        >>and when later I say:
        >>
        >>traceHeaderFi elds.insert(pai r<string,
        >>int>("Geophon eGroupNumberFir stTraceOrigFiel d", 1));
        >>
        >>it crashes out wherease a shorter string works fine:
        >>
        >>traceHeaderFi elds.insert(pai r<string, int>("GeophoneG roupNu", 1));
        >>
        >>Anythin longer than 15 character fails !
        >>
        >>Thanks in advance
        >>
        >>Kamran
        >>
        >
        >
        Are you using an older MS compiler? Where short and long strings have
        a different internal representation, but the debugger doesn't know
        that?
        >
        >
        How does it "crash out"?
        >
        >
        Bo Persson
        >
        >
        Thanks Bo for the tip. I had to upgrade my compiler. Though I still
        don't know why it worked at all for shorter strings. It shouldn't have !

        Kamran

        Comment

        Working...