在 vc++ 6.0编译通过。
- # include <stdio.h>
- # define SIZE 10
-
- void someFunction(int [],int);
- main()
- {
- int a[SIZE]={8,3,1,2,6,0,9,7,4,5};
- printf("Answer is:\n");
- someFunction(a,SIZE);
- printf("\n");
- return 0;
- }
- void someFunction(int b[],int size)
- {
- if (size>0){
- someFunction(&b[1],size-1);
- printf("%d",b[0]);
- }
- }
程序把数组 倒序输出 someFunction函数 &b[1]作为新数组的起始 则下面的b[0]实际是上一句所指的b[1] 经过循环 先前的b[0]成b[1] 再b[1]成b[2]