# [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]
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up