multidimensional arrays

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

    #1

    multidimensional arrays

    I was told not to use the low-level language such as arrays which
    inherited from C, I want to know what can I use to substitute the
    C-style multidimensiona l arrays? Is there multidimensiona l vector?

  • Kai-Uwe Bux

    #2
    Re: multidimensiona l arrays

    asdf wrote:
    I was told not to use the low-level language such as arrays which
    inherited from C, I want to know what can I use to substitute the
    C-style multidimensiona l arrays? Is there multidimensiona l vector?
    E.g.,

    std::vector< std::vector< int


    Best

    Kai-Uwe Bux

    Comment

    • fightwater

      #3
      Re: multidimensiona l arrays


      asdf 写道:
      I was told not to use the low-level language such as arrays which
      inherited from C, I want to know what can I use to substitute the
      C-style multidimensiona l arrays? Is there multidimensiona l vector?
      There are boost library


      see if it fits your needs.

      Comment

      • Jim Langston

        #4
        Re: multidimensiona l arrays

        "asdf" <likemursili@gm ail.comwrote in message
        news:1157932760 .638706.213110@ p79g2000cwp.goo glegroups.com.. .
        >I was told not to use the low-level language such as arrays which
        inherited from C, I want to know what can I use to substitute the
        C-style multidimensiona l arrays? Is there multidimensiona l vector?
        The usually way is to do a vector of vectors, but I find that troublesome,
        and usually wind up encapsulating the 2nd vector. Something like:

        struct MyList
        {
        std::vector<int IntVector;
        };

        std::vector<MyL istMy2DArray;

        I just find the syntax a bit easier than
        std::vector<std ::vector<int My2DArray;


        Comment

        • fightwater

          #5
          Re: multidimensiona l arrays


          Jim Langston 写道:
          "asdf" <likemursili@gm ail.comwrote in message
          news:1157932760 .638706.213110@ p79g2000cwp.goo glegroups.com.. .
          I was told not to use the low-level language such as arrays which
          inherited from C, I want to know what can I use to substitute the
          C-style multidimensiona l arrays? Is there multidimensiona l vector?
          >
          The usually way is to do a vector of vectors, but I find that troublesome,
          and usually wind up encapsulating the 2nd vector. Something like:
          >
          struct MyList
          {
          std::vector<int IntVector;
          };
          >
          Why use a struct here, why not just do
          typedef std::vector<int MyList;
          std::vector<MyL istMy2DArray;
          >
          I just find the syntax a bit easier than
          std::vector<std ::vector<int My2DArray;

          Comment

          • Frederick Gotham

            #6
            Re: multidimensiona l arrays

            asdf posted:
            I was told not to use the low-level language such as arrays which
            inherited from C, I want to know what can I use to substitute the
            C-style multidimensiona l arrays? Is there multidimensiona l vector?

            Long live inefficient code!

            --

            Frederick Gotham

            Comment

            Working...