# [C語言] inplace swap > 作者: Aria > 2024/04/03 ## 程式碼: ```C= void inplace_swap(int *x, int *y) { *y = *x ^ *y; /* Step 1 */ *x = *x ^ *y; /* Step 2 */ *y = *x ^ *y; /* Step 3 */ } ``` Reference: [1] "Computer_Systems_A_Programmers_Perspective(3rd) Practice Problem 2.10 (solution page 182)" [Apr. 3, 2024]