c_language:state_machines
This is an old revision of the document!
Brainstorm
Three different approaches:
- State is kept as a number in a variable. E.g. from a enum. And handled by switch-case
- State is kept as pointer to struct with function pointers
- State is kept as a index pointing to a state-transition table
SO question with interesting answers C state machine design.
An article that might contain good stuff State machine shortcuts
c_language/state_machines.1613727663.txt.gz · Last modified: 2022/09/12 00:30 (external edit)
