+ 1
Recursive macro
I'd like to know if it's possible to make recursive macro, I know what macro does, so it shouldn't be used, but I'd like to know if it's possible For example: #define fact(x) x * ((x) > 0?fact(x-1):1) Output(for fact(5)): 5 * 4 * 3 * 2 * 1 Or maybe: 5 * (5 - 1) * (5 - 1 - 1) *...* 1
2 Answers
+ 1
Ok, thanks... It was just idea :D
0
I saw this thread, I tried one method but sololearn compiles it as error