Just for personal study and better understanding of C code preprocessor :
I am wondering if it is possible to implement Fibonacci function by preprocessor directives in C language.
Normal definition of Fibonacci function could be:
int f(int i) { // i should be non-negative integer
if (i <= 1) {
return 1;
}
return f(i - 1) + f(i - 2);
}
The approach of using the template metaprogramming technique in C++ is not what I need.
It seems that it is not possible to perform recursive calculations by using the code preprocessor?