Pointers are easy - it's just a thing that tells you where to find some other thing.
All items of data, including parts of your program like functions are things, so there's no reason why you shouldn't pass a pointer to a function to a function so it knows who it can call. Or who called it.
Pointers to pointers are stranger beasties, but still - meh.
Maybe that's because I was taught assembly language before I had a class in C.
On the other hand, I still find objects strange - I have to force myself to properly encapsulate.
Recursion on the other hand, takes some brainpower to understand.
- And is stupendously powerful. And very, very dangerous when you run out of stack space. |