- #include <stdio.h>
- #define MAX 10
- int exchange(int *firstNumber , int *lastNumber )
- {
- int temp = 0;
- for( ; firstNumber < lastNumber ; firstNumber++ , lastNumber--)
- {
- temp = *firstNumber ;
- *firstNumber = *lastNumber ;
- *lastNumber = temp;
- }
- }
- int main(int argc,char **argv)
- {
- int i=0 , a[MAX];
- for(i=0 ; i < MAX ; i++)
- {
- a[i] = i;
- }
- exchange(&a[0] , &a[MAX-1]);
- for(i = 0 ; i < MAX ; i++)
- {
- printf("%3d",a[i]);
- }
- printf("\n");
- return 0;
- }