Hello all:
1) Is it possible to pass a function (1) as an argument to another function (2)?
2) If so, how should it be done? Should the declaration/definition of function 2 contain all the function arguments and type of function 1?
3) Is it good style?
I remember seeing an example once where someone did this, but I have spent a lot of time on Google and can't find anything. I'm not sure if this is because I'm using incorrect search terms or if it just isn't a good idea to pass functions to other functions.
If anyone could tell me whether there are any pitfalls in doing this, I would very much appreciate it.
Thanks a lot for any help!
1) Is it possible to pass a function (1) as an argument to another function (2)?
2) If so, how should it be done? Should the declaration/definition of function 2 contain all the function arguments and type of function 1?
3) Is it good style?
I remember seeing an example once where someone did this, but I have spent a lot of time on Google and can't find anything. I'm not sure if this is because I'm using incorrect search terms or if it just isn't a good idea to pass functions to other functions.
If anyone could tell me whether there are any pitfalls in doing this, I would very much appreciate it.
Thanks a lot for any help!