This is a factorial program everything works fine, but the output of fact in main is way off and the variable returning to fact in function factorial is giving the right output.
using namespace std;
int factorial(int *,int); //number and result
cout<<"Enter a number!"<<endl;
cout<<"fact is : "<<fact<<endl;
int factorial(int *n,int r)
r = r * (*n);
cout<<"r is : "<<r<<endl;
This is the second time this happened, so any ideas?
I'm using Dev-cpp, just for the record!