What is wrong with this code? This is a simplified version of what I'm doing. It's a recursive function calls on the same variable.
#include <iostream>
using namespace std;
void Foo(int& x)
{
x++;
Foo(x);
cout<<x<<"\n";
if(x==10)
return;
}
int main()
{
int x=0;
Foo(x);
return 0;
}