C-Frameworks: Basic State Machine Implementation. Pt. 2

How to Use Function Pointers for Implementing Finite State Machines

I posted my solution for Finite State Machines in C using Matrix. Jean-Marc (f1hdi.org) commented to that entry: I would love to have the state event matrix not only returning a ‘next state’ and action to do BUT directly calling ‘actions’ functions. A long time ago , when I was at school, I wrote such ptr function call but can’t reproduce it now. Basically , in your routine below, I would love to replace the ‘return’ by a call to a function which you would have its pointer in the matrix. [Read More]