#include <iostream>
using namespace std;
int recur(int x) {
1 and recur(--x);
cout << x;
return x;
}
int main() {
recur(10);
return 0;
}
#include <iostream> using namespace std; int recur(int x) { 1 and recur(–x); cout <<
Share
is equivalent to
Clearly you are making infinite recursive calls which leads to stack overflow followed by segmentation fault.
I guess you meant
which makes the recursive call only when x is non-zero.