#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, b = %d\n", a
[0], a
[1], b
); return 0;
}
void swap(int *a, int b)
{
int temp;
temp = *a;
*a = b;
b = temp;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnZvaWQgc3dhcChpbnQgKmEsIGludCBiKTsKaW50IG1haW4odm9pZCkKewppbnQgYVs0XSA9IHsxLCAyLCAzLCA0fTsKaW50IGIgPSAzOwpzd2FwKGErMSwgYik7CnByaW50ZigiYVswXSA9ICVkLCBhWzFdID0gJWQsIGIgPSAlZFxuIiwgYVswXSwgYVsxXSwgYik7CnJldHVybiAwOwp9CnZvaWQgc3dhcChpbnQgKmEsIGludCBiKQp7CmludCB0ZW1wOwp0ZW1wID0gKmE7CiphID0gYjsKYiA9IHRlbXA7Cn0=