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. 2D array of CString in MFC

2D array of CString in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++data-structureshelptutorialquestion
5 Posts 3 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.
  • V Offline
    V Offline
    Vickie
    wrote on last edited by
    #1

    Hi all, I want to make a 2D array of CString in MFC. Can I know if it is possible and how to declare and make it work?? Thx for your help!

    J M 2 Replies Last reply
    0
    • V Vickie

      Hi all, I want to make a 2D array of CString in MFC. Can I know if it is possible and how to declare and make it work?? Thx for your help!

      J Offline
      J Offline
      Joe Moldovan
      wrote on last edited by
      #2

      Don't hate me but I don't think you can do it. I gave up after trying for a week. Currently I'm using linked CStringArray objects. Not neat but works.

      V 1 Reply Last reply
      0
      • J Joe Moldovan

        Don't hate me but I don't think you can do it. I gave up after trying for a week. Currently I'm using linked CStringArray objects. Not neat but works.

        V Offline
        V Offline
        Vickie
        wrote on last edited by
        #3

        Why I need to hate you that you gave me advice? ^v^! Anyway, can I know how to use CStringArray to construct a 2D array? Can you show me how to use and declare it? Thx for your sincere help!

        1 Reply Last reply
        0
        • V Vickie

          Hi all, I want to make a 2D array of CString in MFC. Can I know if it is possible and how to declare and make it work?? Thx for your help!

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          You do it just like with any other type: CString myarray[20][10]; --Mike-- http://home.inreach.com/mdunn/ Time is an illusion; lunchtime doubly so.

          J 1 Reply Last reply
          0
          • M Michael Dunn

            You do it just like with any other type: CString myarray[20][10]; --Mike-- http://home.inreach.com/mdunn/ Time is an illusion; lunchtime doubly so.

            J Offline
            J Offline
            Joe Moldovan
            wrote on last edited by
            #5

            I think I misunderstood something. (Read it at 4.30am so...) What I tried to do was a 2D CStringArray, derived from CStringArray, so that I could dynamicaly assign CString objects and have the array class allocate and clean up at run-time. I'm using "CStringArray fred[ 2 ]" at the moment. This is not neat at all as I said but works OK. I ass-u-med the original post was about this.

            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