I decided to change the scope of a function operator from global to local. After changing from the commented code, I found that my code no longer runs and exits with error:
C4700 uninitialized local variable 'n' used.\
This seems to be a quite obvious contradiction to the actual method of local resolution. Does anyone have an explanation for this?
int Combs::factorial(int a)
{
//value = 1;
int n;
for (int i = a; i >0; i--)
{
n *= i;
}
cout << n;
return n;
}