2 * This simple classical example of recursion is useful for
3 * testing stack backtraces and such.
10 /* VxWorks does not supply atoi. */
17 while (*z
>= '0' && *z
<= '9')
18 i
= i
* 10 + (*z
++ - '0');
22 /* I don't know of any way to pass an array to VxWorks. This function
23 can be called directly from gdb. */
32 main (2, argv
, (char **) 0);
37 #endif /* ! vxworks */
39 main (argc
, argv
, envp
)
44 printf ("usage: factorial <number>\n");
47 printf ("%d\n", factorial (atoi (argv
[1])));
56 value
*= factorial (value
- 1);
This page took 0.030766 seconds and 4 git commands to generate.