Is there a collection data structure that I can use to hold and manipulate different types of objects (i.e. Vector)? I have been trying an Object array, however, it is extremely limited and doesn't seem to work right.
1
Expert's answer
2010-08-09T10:55:53-0400
You can not use a vector or an array of objects of different types. It's possible only if they inherited from one class, and need to store an array or vector of objects of this class. So using an array or vector of objects - the only possible solution if you do not know what will be in this array. Try to build your code in different way if this solution doesn't fit .
Comments
Leave a comment