#include void swap(int* a, int* b) { int t = *a; *a = *b; *b = t; } int main() { int a = 1; int b = 2; printf("a=%i, b=%i\n", a, b); swap(&a, &b); printf("a=%i, b=%i\n", a, b); return 0; }