I understand I can use pointers for functions.
Can someone explain why one would use them, and how? Short example code would be very helpful to me.
I'm surprised no one mentioned "state machines". Function pointers are a very common way to implement state machines for tasks such as parsing. See for example: link.