This swap function is fully functional except when the input is two arrays with the same values:
void permuter(int* a, int* b) {
*a = *a + *b;
*b = *a - *b;
*a = *a - *b;
}
int main(void) {
int i[0];
int j[0];
i[0] = 5;
j[0] = 5;
permuter(&j[0], &i[0]);
return 0;
}
using printf();
i[0] = 0
and j[0] = 0
.