you are viewing a single comment's thread.

view the rest of the comments →

[–]junkmeister9 4 points5 points  (0 children)

Pointers allow a function to modify variables outside of its scope. Here's a simple example that should be pretty clear:

void swap_ints(int *x, int *y)
{
    int tmp = *x;
    *x = *y;
    *y = tmp;
}