Skip to content · ⁨본문 바로가기⁩

Swap two values · ⁨두 값 swapping⁩

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은 자신이 가리키는 값을 읽거나 쓸 수 있습니다. 다른 값을 복사하는 동안 하나를 잃지 않도록 임시 변수를 사용하세요.

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP