array of classes

This is a discussion on array of classes within the C++ Programming forums, part of the General Programming Boards category; Is here a way to create an array that can grow as my input file grows and that can hold ...

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    1

    array of classes

    Is here a way to create an array that can grow as my input file grows and that can hold classes in C++ or C# and how do I do it, or would I be better of using a Red Black Tree?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,268
    You can use the std::vector container. If you want a sorted container, a std::set or std::map (both typically implemented with a balanced binary tree such as a red-black tree) might be appropriate.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Overloading Array Objects for use with Classes
    By ibleedart in forum C++ Programming
    Replies: 2
    Last Post: 10-24-2007, 07:48 PM
  2. Modify an single passed array element
    By swgh in forum C Programming
    Replies: 3
    Last Post: 08-04-2007, 09:58 AM
  3. Char array and classes
    By Heineken in forum C++ Programming
    Replies: 3
    Last Post: 04-25-2005, 01:32 PM
  4. two-dimensional dynamic array of pointers to classes
    By Timo002 in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 07:18 AM
  5. array of classes in C++
    By stanleyw in forum C++ Programming
    Replies: 2
    Last Post: 05-29-2002, 09:20 PM

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