Hi, I'm wondering if it is possible to access a property of a class dynamically without knowing the name of the property accessed at run-time.
To give you a better understanding of what I'm aiming at, this php code should demonstrate what I want to do:
<?php
$object = new object();
$property = get_name_out_of_textfile();
echo $object->$property;
?>
I know that is it not possible to do the exact same thing but let's say I got the name of an attribute in a cstring of std::string and want to access the attribute matching the name. Is there a way to do that?
The background is that I want to dynamically load and save data from a class with lots of attributes. I can save the in any format I want but I need a way to load them back in again without specifying the exact attribute every time.
Thanks in advance for any help, Robin.