[Solved] How to alternate from one function to another


ok, calling main is not a good idea, but I guess the question is more about how having 2 functions calling each other.

you need to forward declare at least one:

int write(); //forward declare

int read() {
   return write(); // use write which is still forward declared for now
}

int write() { // now defining write
   return read();
}

obviously this sample code is meaning less (infinite loop), but it illustrates how to do that.

0

solved How to alternate from one function to another