Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 2-dimensional array of strings

2-dimensional array of strings

Scheduled Pinned Locked Moved C / C++ / MFC
data-structurestutorial
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    namy1
    wrote on last edited by
    #1

    Hi all, can ne one tell me how to create a 2-dimensional array of strings thnx

    S T S 4 Replies Last reply
    0
    • N namy1

      Hi all, can ne one tell me how to create a 2-dimensional array of strings thnx

      S Offline
      S Offline
      sunit5
      wrote on last edited by
      #2

      char x[][10]={"fsfhg", "abc" };

      never say die

      1 Reply Last reply
      0
      • N namy1

        Hi all, can ne one tell me how to create a 2-dimensional array of strings thnx

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        std::vector<std::vectorstd::string > vec2D;


        Don't know where to start ?
        Refer the Forums Guidelines and ask a friend

        [VisualCalc 3.0][Flags Beginner's Guide]

        1 Reply Last reply
        0
        • N namy1

          Hi all, can ne one tell me how to create a 2-dimensional array of strings thnx

          S Offline
          S Offline
          sunit5
          wrote on last edited by
          #4

          or u can go for char(*p)[20]

          never say die

          1 Reply Last reply
          0
          • N namy1

            Hi all, can ne one tell me how to create a 2-dimensional array of strings thnx

            S Offline
            S Offline
            Sam Hobbs
            wrote on last edited by
            #5

            In addition to what toxcct said, you can create a class to help with the details of your specific requirements; see vector of vectors for rows and fields[^] for a beginning of what can be done.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups