Collections

This is a discussion on Collections within the C++ Programming forums, part of the General Programming Boards category; Hello, I'm new ap c++ programming, and I can't find out how to use collections of objects. I hope you ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    1

    Question Collections

    Hello, I'm new ap c++ programming, and I can't find out how to use collections of objects.

    I hope you can help me out!!

    Thanks anyway

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    collections of similar objects is often done using a built in container like an array or a simple user container like a list, queue, or stack. The Standard Template Library (STL) has standardized containers that should be available in any up to date compiler. The STL containers are called string, vector, list, stack, queue, dequeue, map, tree, etc. These containers are built in classes with a number of methods to perform routine tasks associated with the given container, as well as a series of generic algorhythms that can be used on STL container classes as well as user defined containers, assuming certain criteria are met. Assuming you won't be using the STL for now, I would focus on use of arrays first. Once you feel comfortable there, designing your own list class is very instructional.

    If the objects aren't the same, then you can assemble them into their own "type" by declaring your own struct/class.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Classes & Collections
    By Max_Payne in forum C++ Programming
    Replies: 7
    Last Post: 12-11-2007, 12:06 PM
  2. Messing with listbox collections and random fun
    By DanFraser in forum C# Programming
    Replies: 0
    Last Post: 06-20-2005, 07:40 PM
  3. foreach with collections
    By Korn1699 in forum C# Programming
    Replies: 1
    Last Post: 12-03-2004, 02:12 AM
  4. Strongly typed collections
    By CompiledMonkey in forum C++ Programming
    Replies: 2
    Last Post: 06-04-2004, 09:25 PM
  5. Icon collections
    By _Elixia_ in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 07-12-2003, 04:41 PM

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