I went back and read a bunch of your posting history, wondering what is on your mind.
It seems to me like you have been trying for some time to solve the problem of building a dynamic chain of functions..
One function leads to the next etc. This it not easy to do because.. Its a bad idea. When a function is entered it eats up a chunk of RAM for its local variables and return address. This is why Arduino people fear/discourage recursive methods of writing code.
But.. What you could do, that would possibly solve your issue and keep things manageable, is write some sort of delegation function.
You would enter the delegation function with some sort of input you needed worked on. It would delegate/call the first sub function to deal with the first process of whatever you are doing. In that sub function, you return something that tells the calling delegator function what sub function to call next. On and on.
In this way you can chain together functions, but by returning to your delegator each time to be re-directed along your chain, you release each sub function's RAM along the way.
Does this make any sense? Or have I just missed the point entirely?
Thanks for the example in reply #1, I have always struggled with pointers in C and C++. The concept is simple enough but it confuses me for some reason. I have taken your example and modified it and it still works, so I guess I must understand it.
Thanks for the example in reply #1, I have always struggled with pointers in C and C++. The concept is simple enough but it confuses me for some reason. I have taken your example and modified it and it still works, so I guess I must understand it.
++Karma;
I always thought of it like things with strings attached. The strings are the pointers.