An example of how to implement a simple traffic light example, on an Arduino, implemented in 4 ways, a switch case, a table of function pointers, and a table of structs, stored in RAM and program memory.
There is a Youtube video which explains the code, and the differences between each implementation: https://youtu.be/eB3x047C4Ek