Not-endless Recursion without a base case
C - factorial
simple as that
int not_factorial(int n){return 1;}
int factorial(int n)
{
    int (*maybe_factorial[])(int) = {factorial, not_factorial};
    return n*maybe_factorial[!(n-1)](n-1);
}

the function factorial is almost like a basic recursive approach but not_factorial only returns 1.If I create an array of function pointers
(0: fac, 1: not_fac), then I can control which one should be executed at the next call:
maybe_factorial[0](n-1) calls factorial
maybe_factorial[1](n-1) calls not_factorial.
!(n-1) means if n &gt; 1 return 0 else return 1