Posted on Mar 21, 2009

Posted on Mar 18, 2009

Did you know…

that a quantum leap is the smallest possible step from a high energetic potential to a low energetic potential?

Posted on Mar 18, 2009

Finite State Machine Matrix-Style-C-Implementation (Function Pointers Addon)

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.
Any idea ?

The simple answer to Jean-Marc’s questions is “Yes” and I’m really sorry that I hadn’t got the time to answer sooner. The basic idea of using function pointers is the right choice to find a solution for this task.

Continue Reading