Truyền tham số theo hình thức tham chiếu

Code: C | Auth: 03cd82
#include <stdio.h>
void HoanVi(int *a, int *b){
	int c = *a;
		*a = *b;
		*b = c;
	printf("\nTrong ham hoan vi: a = %d, b = %d ", *a, *b);
}
void main(){
	int x = 2, y=6;
	printf("\nTruoc: x = %d, y = %d ", x, y);
	
	HoanVi(&x, &y);
	printf("\nSau: x = %d, y = %d ", x, y);
}