Liste des Groupes | Revenir à cl c |
int factorial(int n)This one is tricky. Depending on the parameter value, implementation capabilities and the optimizer quality it may either calculate something (which would even be the correct factorial value, for sufficiently small arguments) or cause an integer overflow or a stack overflow. These may or may not terminate the program, depending on the compiler, runtime environment and OS details.
{
if (n >= 1)
return n*factorial(n-1);
else
return 1;
}
Les messages affichés proviennent d'usenet.