fact is not a variable. It's the address of your function i.e. a pointer.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
#include <iostream>
long fact(long number);
int main()
{
long number = 0;
std::cout << "enter the number: ";
std::cin >> number;
std::cout << "factorial of " << number << " is " << fact(number) << "\n";
}
long fact (long number)
{
long fact = 1;
for (int i = 1; i <= number; i++)
{
fact *= i;
}
return fact;
}