I know this is a strange question but is there a way to use pointers to return to a certain point in the code? What I'm trying to do is mimic the behavior of a jal instruction in MIPS.
For instance, if I have a function fun1() that returns 1, and another function fun2() that returns 2, and main() as defined here:
1 main() {
2 int v = fun1(); // v = 1
3 if (v == 2) return 2;
4 v = fun2(); // v = 2
5 }
Could I jump back to line 3 after fun2() is called in line 4 by keeping a pointer to the return address of the call to fun1 on line 2?