Challenge 2: swap(int *a, int *b) — Possible Solution ==================================================================== #include void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } int main() { int x = 1; int y = 2; printf("Before: x=%d y=%d\n", x, y); swap(&x, &y); printf("After: x=%d y=%d\n", x, y); return 0; } Output: Before: x=1 y=2 After: x=2 y=1 WHY THIS WORKS AS AN ANSWER ------------------------------ swap receives pointers to x and y (their addresses via &x/&y, not copies of their values), so *a and *b inside the function refer directly to main's own variables -- the temp-based swap genuinely exchanges their contents. This is exactly Chapter 5's own pass-by-value limitation solved: swapping two ints by value alone is impossible in C (the function would only swap its own local copies), which is precisely why pointers, introduced in this chapter, exist.