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
Printable View
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
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.