For instance I create a class having one member of type bool and 100 objects.
Now if I want to perform certain actions with those objects that have their member as true, do I have to perform the action separately for each object, or is there a way to perform that action collectively.
In other words is there a way to:
Check the values of all the objects of a class, and for those that are true, perform certain actions?
Now if I want to perform certain actions with... objects..., do I have to perform the action separately for each object, or is there a way to perform that action collectively.
The instances of a class are only stored in the variables you tell them to be stored in. So in short, no. There is no short cut way to access all the instances as a collection, unless you designed your class that way. Example: