Swap two values · 두 값 swapping
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
Swap two values
swap receives pointers to two integers and must exchange their values. Through a pointer, *a reads — or writes — the value it points at. Use a temporary variable so you don't lose one value while copying the other.
한국어
두 값互换
swap은 두 정수에 대한 포인터를 받아 값이 서로 바뀌도록 합니다. 포인터를 통해 *a은 자신이 가리키는 값을 읽거나 쓸 수 있습니다. 다른 값을 복사하는 동안 하나를 잃지 않도록 임시 변수를 사용하세요.
Complete void swap(int *a, int *b) to exchange the two integers that a and b point to. Use the pointers — *a is the value at a. · void swap(int *a, int *b)를 완성하여 a과 b가 가리키는 두 정수를交换(바꿔)하십시오. 포인터를 사용하십시오 — *a은 a에 있는 값입니다.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.