CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Location
    beyond the pillars of hercules
    Posts
    295

    [RESOLVED] Array question

    i want to create a 2D char array. my issue is that i dont know how many Rows i will need for the array...

    how can i keep adding rows to the array?

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Array question

    Quote Originally Posted by Cpp_Noob View Post
    i want to create a 2D char array. my issue is that i dont know how many Rows i will need for the array...
    Dynamic arrays in C++ are taken care of by the std::vector class. If the char arrays are actually strings, then std::string is used.
    Code:
    #iinclude <vector>
    #include <string>
    std::vector<std::string> StringArray;
    how can i keep adding rows to the array?
    vector::push_back()

    Regards,

    Paul McKenzie
    Last edited by Paul McKenzie; May 8th, 2010 at 09:55 AM.

  3. #3
    Join Date
    May 2006
    Location
    beyond the pillars of hercules
    Posts
    295

    Re: Array question

    thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured