로딩
요청 처리 중입니다...

[c언어] 포인터 순환 스왑 a를 b로, b를 c로, c를 a로 옮기는 함수

 [c언어] 포인터 순환 스왑 a를 b로, b를 c로, c를 a로 옮기는 함수

#include void cyclic_swap(int *a, int *b, int *c) { int temp1, temp2; temp1 = *b; *b = *a; temp2 = *c; *c = temp1; *a = temp2; } int main() { int first, second, third; printf("Enter three integers.\n"); scanf("%d%d%d", &first, &second, &third); printf("Before cyclic swap: a = %d, b = %d, c = %d.

\n", first, second, third); cyclic_swap(&first, &second, &third); printf("After cyclic swap: a = %d, b = %d, c = %d.\n", first, second, third); return 0; }...

# c언어 # c언어순환스왑 # c언어스왑함수 # c언어포인터스왑함수