Since we seem to be comparing implementations... from one of my entries to the "500 ways to program 1-10" thread:
unsigned long A(unsigned long m, unsigned long n)
{
if(!m)
return n+1;
if(!n)
return A(m-1, 1);
return A(m-1, A(m, n-1));
}
[edit:] As to your code, couple stylistic issues:
- you forward declare the function, then immediately define it. You could take the declaration out.
- you use local variables whose values are just the same as your parameter values. No need for those either.