User Tools

Site Tools


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.

c_language/state_machines.1613574517.txt.gz · Last modified: 2022/09/12 00:30 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki