Lets say that I have a variable
of which I don't know the number of levels and that I would like to use this path as "address" of a variable inside a structure, such that
Now, I know that I can use string variables to set or get structure fileds using a notation like
But this works with one level or, with a bit of string manipulation, if I know the number of levels I must call. I'm thinking at something like:
Can you think of any kind of trick so that I can write a function that adapt itself to the number of levels I pass it through the path variable?