So If I have a struct as follows:
struct MyObject {
int x;
int y;
};
Is there any way to get or manipulate MyObject's data members WITHOUT knowing their name?
In other words, achieving the same thing as:
MyObject.x = 10;
, but given that I don't know that MyObject has data member named x..
So something like this:
MyObject[0] = 10; // x = MyObject's first data member....
MyObject[1] = 20; // y = MyObject's second data member....