There are many functions of the same type of FI, where I is the number and index of the function, for example:

byte F5( byte COMMAND ); byte F3456( byte COMMAND ); 

The function performs actions in accordance with the COMMAND command. The function COMMAND_ID function returns its index I

Question: How to call a function recursively without using its name (FI ())? Perhaps somehow through this?

Thank you.

  • But you can find out what is the reason for the use of the name f-ii? - isnullxbh
  • Adding pointers to an array and calling on an index is not it? - Harry
  • Not it. That is, the recursive function call is interested in itself from itself without specifying a name. I thought that in c ++ it is possible. There are many functions, because in fact, each function is a unique algorithm. For debugging purposes, a lot of algorithms are flashed into the firmware at once, and they switch over to the dynamics. The function index is a unique index of the algorithm. - Osetroff
  • The algorithm can invoke itself. It is very inconvenient, as in the case of debug output (which indicates the index of the algorithm), and in the case of a recursive call, to use a specific function name. GOTO would help here :) - Osetroff
  • This can be done with functors. struct Foo{void operator()(){ (*this)();}}; - yrHeTaTeJlb

0