How to access a variable that's inside a class & Check equality between variables in any object from the array
in
Programming Questions
•
7 months ago
I'm programming a game and I have an array of objects (one array that contains 100 copies of one class).
For the game to work properly I need a function outside that class that would look like this:
check if another variable (c) from the first class == another variable (d) from the second class
if so than do this and this....
}
The question is: How the hell can I program that???
The most important things I need for this task are:
1. How to access a variable that's inside a class.
2. Check equality between variables in any object. (Not a random object, not all objects, but ANY object)
I'm not sure if my explanation is ok, but anyway
Thanks for help!
1