Managed Vector

This is a discussion on Managed Vector within the C# Programming forums, part of the General Programming Boards category; I am wondering how a "Managed vector" is declared. I have worked much with: std::vector<string> OneVector; How is the same ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    383

    Managed Vector

    I am wondering how a "Managed vector" is declared.
    I have worked much with:
    std::vector<string> OneVector;

    How is the same declared for a Managed type ?

    What I am trying to do is to translate this to managed and importantly
    use a push_back method for the managed type:

    Code:
    std::vector<string> OneVector;
    std::string Stuff = "Hello";
    
    OneVector.push_back(Stuff);

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Code:
    System.Collections.Generic.List<string> OneVector = new System.Collections.Generic.List<string>();
    OneVector.Add("Hello");
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    383
    Thank you... I did one change to it though:

    Code:
    System.Collections.Generic.List<String^> OneVector = new System.Collections.Generic.List<String^>();

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can some one please tell me the cause of the error ?
    By broli86 in forum C Programming
    Replies: 8
    Last Post: 06-26-2008, 08:36 PM
  2. syntax help?
    By scoobygoo in forum C++ Programming
    Replies: 1
    Last Post: 08-07-2007, 10:38 AM
  3. Vector class
    By Desolation in forum C++ Programming
    Replies: 2
    Last Post: 05-12-2007, 05:44 PM
  4. Need some help/advise for Public/Private classes
    By nirali35 in forum C++ Programming
    Replies: 8
    Last Post: 09-23-2006, 12:34 PM
  5. Certain functions
    By Lurker in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2003, 12:26 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21