#include <stdio.h>
void swap(int *a, int b);
int main(void)
{
int a[4] = {1, 2, 3, 4};
int b = 3;
swap(a+1, b);
printf("a[0] = %d, a[1] = %d,%d %d b = %d\n", a
[0], a
[1], a
[2], a
[3], b
); return 0;
}
void swap(int *a, int b)
{
int temp;
temp = *a;
*a = b;
b = temp;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnZvaWQgc3dhcChpbnQgKmEsIGludCBiKTsKaW50IG1haW4odm9pZCkKewppbnQgYVs0XSA9IHsxLCAyLCAzLCA0fTsKaW50IGIgPSAzOwpzd2FwKGErMSwgYik7CnByaW50ZigiYVswXSA9ICVkLCBhWzFdID0gJWQsJWQgJWQgYiA9ICVkXG4iLCBhWzBdLCBhWzFdLCBhWzJdLCBhWzNdLCBiKTsKcmV0dXJuIDA7Cn0Kdm9pZCBzd2FwKGludCAqYSwgaW50IGIpCnsKaW50IHRlbXA7CnRlbXAgPSAqYTsKKmEgPSBiOwpiID0gdGVtcDsKfQ==